From 37d27cec40803336556c465020be48bc98212a14 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Mon, 7 Mar 2016 09:59:15 -0300 Subject: [PATCH] create compound index for walletId, createdOn. drop old index --- lib/storage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/storage.js b/lib/storage.js index c77e3a4..3011cbb 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -50,7 +50,8 @@ Storage.prototype._createIndexes = function() { id: 1, }); this.db.collection(collections.ADDRESSES).createIndex({ - walletId: 1 + walletId: 1, + createdOn: 1, }); this.db.collection(collections.ADDRESSES).createIndex({ address: 1, @@ -63,6 +64,11 @@ Storage.prototype._createIndexes = function() { type: 1, key: 1, }); + + + this.db.collection(collections.ADDRESSES).dropIndex({ + walletId: 1 + }); }; Storage.prototype.connect = function(opts, cb) {