浏览代码

[ENH] Add index on CardId into Comments collection

fmonthel 8 年之前
父节点
当前提交
f71d2538fa
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      models/cardComments.js

+ 4 - 4
models/cardComments.js

@@ -57,10 +57,10 @@ CardComments.helpers({
 CardComments.hookOptions.after.update = { fetchPrevious: false };
 CardComments.hookOptions.after.update = { fetchPrevious: false };
 
 
 if (Meteor.isServer) {
 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) => {
   CardComments.after.insert((userId, doc) => {