From f71d2538fa15c9d8eb915d7b4dd9eb6a337d203d Mon Sep 17 00:00:00 2001 From: fmonthel Date: Thu, 17 Nov 2016 21:23:39 -0500 Subject: [ENH] Add index on CardId into Comments collection --- models/cardComments.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/cardComments.js b/models/cardComments.js index ccad14f7..2cadb65e 100644 --- a/models/cardComments.js +++ b/models/cardComments.js @@ -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) => { -- cgit v1.2.3-1-g7c22