new ReplSet(servers, options){ReplSet}
Creates a new ReplSet instance
Name | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
servers |
Array.<Server> |
A seedlist of servers participating in the replicaset. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
object | null |
optional
Optional settings.
|
- Deprecated
- Yes
Properties:
Name | Type | Description |
---|---|---|
parserType |
string | the parser type used (c++ or js). |
Fires:
- ReplSet#event:connect
- ReplSet#event:ha
- ReplSet#event:joined
- ReplSet#event:left
- ReplSet#event:fullsetup
- ReplSet#event:open
- ReplSet#event:close
- ReplSet#event:error
- ReplSet#event:timeout
- ReplSet#event:parseError
Returns:
ReplSet instance.Methods
-
connections(){array}
-
All raw connections
-
unref()
-
Unref all sockets
Events
-
close
-
ReplSet close event
Type:
- object
-
connect
-
A replset connect event, used to verify that the connection is up and running
Type:
-
error
-
ReplSet error event, emitted if there is an error listener.
Type:
-
fullsetup
-
ReplSet fullsetup event, emitted when all servers in the topology have been connected to.
Type:
- Replset
-
The replset high availability event
Type:
- function
Name Type Description type
string The stage in the high availability event (start|end)
data.norepeat
boolean This is a repeating high availability process or a single execution only
data.id
number The id for this high availability request
data.state
object An object containing the information about the current replicaset
-
joined
-
A server member joined the replicaset
Type:
- function
Name Type Description type
string The type of member that joined (primary|secondary|arbiter)
server
Server The server object that joined
-
left
-
A server member left the replicaset
Type:
- function
Name Type Description type
string The type of member that left (primary|secondary|arbiter)
server
Server The server object that left
-
open
-
ReplSet open event, emitted when replicaset can start processing commands.
Type:
- Replset
-
parseError
-
ReplSet parseError event
Type:
- object
-
timeout
-
ReplSet timeout event
Type:
- object