Skip to content

Commit

Permalink
docs(connections): clarify multi-mongos with useMongoClient for 4.x docs
Browse files Browse the repository at this point in the history
Re: #5984
  • Loading branch information
vkarpov15 committed Jan 20, 2018
1 parent 718e777 commit 07feb5a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/connections.jade
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,16 @@ block content

h3#mongos_connections Multi-mongos support
:markdown
High availability over multiple `mongos` instances is also supported. Pass a connection string for your `mongos` instances and set the `mongos` option to true:
High availability over multiple `mongos` instances is also supported.
Pass a connection string for your `mongos` instances. If you are not using
the `useMongoClient` option, you must also set the `mongos` option:
:js
mongoose.connect('mongodb://mongosA:27501,mongosB:27501', { mongos: true }, cb);
:markdown
With `useMongoClient`, you do not need to set the `mongos` option. You also
do **not** need to use `mongos` or `useMongoClient` in mongoose 5.x.
:js
mongoose.connect('mongodb://mongosA:27501,mongosB:27501', { useMongoClient: true }, cb);

h3#multiple_connections Multiple connections
:markdown
Expand Down

0 comments on commit 07feb5a

Please sign in to comment.