Skip to content

Instantly share code, notes, and snippets.

View ppbntl19's full-sized avatar
🎯
Focusing

Pooran Prakash ppbntl19

🎯
Focusing
View GitHub Profile
@ppbntl19
ppbntl19 / mongoose-connection-options.js
Last active November 11, 2016 06:53
mLab recommended mongoose connection options. More supported connections for the underlying Node Native driver can be found here: http://mongodb.github.io/node-mongodb-native/
// mongoose 4.3.x
var mongoose = require('mongoose');
/*
* Mongoose by default sets the auto_reconnect option to true.
* We recommend setting socket options at both the server and replica set level.
* We recommend a 30 second connection timeout because it allows for
* plenty of time in most operating environments.
*/
var options = {