From 00b53ac4cbff8467ad240e78788d809a9ccff2a0 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Mon, 31 Oct 2016 14:24:28 -0300 Subject: [PATCH] add index to TXS & TX_NOTES --- lib/storage.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/storage.js b/lib/storage.js index 6682679..e6a43f8 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -46,6 +46,10 @@ Storage.prototype._createIndexes = function() { isPending: 1, txid: 1, }); + this.db.collection(collections.TXS).createIndex({ + walletId: 1, + createdOn: -1, + }); this.db.collection(collections.NOTIFICATIONS).createIndex({ walletId: 1, id: 1, @@ -65,13 +69,7 @@ Storage.prototype._createIndexes = function() { type: 1, key: 1, }); - - - this.db.collection(collections.ADDRESSES).dropIndex({ - walletId: 1 - }); - - this.db.collection(collections.TX_NOTES).dropIndex({ + this.db.collection(collections.TX_NOTES).createIndex({ walletId: 1, txid: 1, });