Class: ConnectionPool

ConnectionPool

Configure MongoDB connections using the same connection pool. Uses Mongoose >4.1.0 for Promise integration


new ConnectionPool(name, uri [, options])

Parameters:
Name Type Argument Description
name String

: name of this connection pool; a global variable with this name will be created referencing the connection created

uri Object

: DB URI

options Object <optional>

: connection options

Properties
Name Type Argument Default Description
direct Object <optional>
false

: create a connection pool using Mongo direct client (not just mongoose); accessible through global variable 'name' (if options.mongoose == false) or 'name+"_direct"' (in any case)

mongoose Object <optional>
true

: create a connection pool using Mongoose helper; accessible through global variable 'name'

Source: