[ENH] Add index on CardId into Comments collection

This commit is contained in:
fmonthel 2016-11-17 21:23:39 -05:00
parent d11f069b60
commit f71d2538fa

View file

@ -57,10 +57,10 @@ CardComments.helpers({
CardComments.hookOptions.after.update = { fetchPrevious: false };
if (Meteor.isServer) {
// Comments are often fetched within a card, so we create an index to make these
// queries more efficient.
Meteor.startup(() => {
CardComments._collection._ensureIndex({ cardId: 1, createdAt: -1 });
// Comments are often fetched within a card, so we create an index to make these
// queries more efficient.
Meteor.startup(() => {
CardComments._collection._ensureIndex({ cardId: 1, createdAt: -1 });
});
CardComments.after.insert((userId, doc) => {