Created
December 11, 2014 09:58
-
-
Save gistfrojd/7fba207ab44272741ac0 to your computer and use it in GitHub Desktop.
How to handle separate read and write servers in mongoose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var uri = "mongodb://write.server.com/mydatabase,read.server.com/mydatabase?replicaSet=rs-test&readPreference=nearest"; | |
connection = mongoose.connection; | |
mongoose.connect(uri, {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment