Merge pull request #1284 from coralproject/action-index

Action index
This commit is contained in:
Kim Gardner
2018-01-18 11:01:43 -05:00
committed by GitHub
+11
View File
@@ -37,6 +37,17 @@ const ActionSchema = new Schema(
}
);
// Create an index on the `item_id` field so that queries looking for
// actions based on the item id can resolve faster.
ActionSchema.index(
{
item_id: 1,
},
{
background: true,
}
);
const Action = mongoose.model('Action', ActionSchema);
module.exports = Action;