Skip to content

Commit

Permalink
🐛 Fix MongoStore missing index
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBoy committed Oct 15, 2019
1 parent 4e281d6 commit c271b96
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions lib/store/MongoStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class MongoStore extends Store {
Object.assign(
{
useNewUrlParser: true,
autoIndex: false,
},
options.dbOptions
)
Expand All @@ -112,27 +111,18 @@ class MongoStore extends Store {
.then(() => {
// we're connected!
debug('Mongodb connected!');
//Models
this.Signature = conn.model('Signature', SignatureSchema);
this.GlobalToken = conn.model('GlobalToken', GlobalTokenSchema);
this.OAuthToken = conn.model('OAuthToken', OAuthTokenSchema);
this.CardTicket = conn.model('CardTicket', CardTicketSchema);
// this.Signature.syncIndexes();
this.initializeTokenFromDB();
})
.catch(err => {
/* istanbul ignore next */
debug(err);
});

// conn.on('error', err => {
// debug(err);
// });
// conn.once('open', () => {
// // we're connected!
// debug('Mongodb connected!');
// this.initializeTokenFromDB();
// });

//Models
this.Signature = conn.model('Signature', SignatureSchema);
this.GlobalToken = conn.model('GlobalToken', GlobalTokenSchema);
this.OAuthToken = conn.model('OAuthToken', OAuthTokenSchema);
this.CardTicket = conn.model('CardTicket', CardTicketSchema);
}

/**
Expand Down

0 comments on commit c271b96

Please sign in to comment.