Merge pull request #720 from matiu/opt/db-indexes2

Opt/db indexes2
This commit is contained in:
Matias Alejo Garcia 2017-11-02 08:00:02 -03:00 committed by GitHub
commit a04ac1383c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 0 deletions

44
.jshintrc Normal file
View File

@ -0,0 +1,44 @@
{
"bitwise": true,
"camelcase": true,
"curly": true,
"devel": false,
"eqeqeq": true,
"eqnull": false,
"freeze": true,
"funcscope": false,
"immed": true,
"indent": 2,
"latedef": "nofunc",
"maxcomplexity": 10,
"maxdepth": 4,
"maxerr": 99999,
"maxlen": 120,
"maxparams": 4,
"maxstatements": 15,
"mocha": true,
"newcap": true,
"noarg": true,
"node": true,
"noempty": true,
"nonew": true,
"quotmark": "single",
"regexp": true,
"smarttabs": false,
"strict": true,
"trailing": true,
"undef": true,
"unused": true,
"predef": [
"after",
"afterEach",
"before",
"beforeEach",
"describe",
"exports",
"it",
"xit",
"module",
"require"
]
}

View File

@ -40,6 +40,9 @@ Storage.prototype._createIndexes = function() {
this.db.collection(collections.COPAYERS_LOOKUP).createIndex({
copayerId: 1
});
this.db.collection(collections.COPAYERS_LOOKUP).createIndex({
walletId: 1
});
this.db.collection(collections.TXS).createIndex({
walletId: 1,
id: 1,
@ -53,6 +56,9 @@ Storage.prototype._createIndexes = function() {
walletId: 1,
createdOn: -1,
});
this.db.collection(collections.TXS).createIndex({
txid: 1
});
this.db.collection(collections.NOTIFICATIONS).createIndex({
walletId: 1,
id: 1,
@ -79,6 +85,14 @@ Storage.prototype._createIndexes = function() {
walletId: 1,
txid: 1,
});
this.db.collection(collections.PREFERENCES).createIndex({
walletId: 1
});
this.db.collection(collections.FIAT_RATES).createIndex({
provider: 1,
code: 1,
ts: 1
});
this.db.collection(collections.PUSH_NOTIFICATION_SUBS).createIndex({
copayerId: 1,
});