create compound index for walletId, createdOn. drop old index

This commit is contained in:
Ivan Socolsky 2016-03-07 09:59:15 -03:00 committed by Matias Alejo Garcia
parent 08cb603a50
commit 37d27cec40
1 changed files with 7 additions and 1 deletions

View File

@ -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) {