From 7c4347736c20cd8818187581ebf14b3d47b29e97 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Wed, 4 Dec 2013 21:35:38 -0500 Subject: [PATCH] added index on _key --- src/database/mongo.js | 8 ++++++-- src/routes/debug.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/database/mongo.js b/src/database/mongo.js index 0513248b85..54802b0eda 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -26,8 +26,12 @@ }); - db.createCollection('objects', function(err, _collection) { - + db.createCollection('objects', function(err, collection) { + collection.ensureIndex({_key :1}, {background:true}, function(err, name){ + if(err) { + winston.error("Error creating index " + err.message); + } + }); }); callback(err); diff --git a/src/routes/debug.js b/src/routes/debug.js index 99f2f584c9..812f49d1da 100644 --- a/src/routes/debug.js +++ b/src/routes/debug.js @@ -350,7 +350,7 @@ var DebugRoute = function(app) { isMemberOfSets ]; - require('async').series(objectTasks, function(err, results) { + require('async').series(setTasks, function(err, results) { if(err) { console.log(err); res.send(err.message);