From 1be6a253bf189dc24721047aa423a9d0e4549116 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 15 Oct 2014 15:07:30 -0400 Subject: [PATCH] make _key value index unique --- src/database/mongo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database/mongo.js b/src/database/mongo.js index 253fd78fbe..9862d86571 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -112,7 +112,7 @@ } }); - db.collection('objects').ensureIndex({_key :1, value: -1}, {background:true}, function(err) { + db.collection('objects').ensureIndex({_key :1, value: -1}, {background:true, unique: true}, function(err) { if(err) { winston.error('Error creating index ' + err.message); }