new ReplSet(servers, options){ReplSet}
| 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
- ReplSet#event:commandStarted
- ReplSet#event:commandSucceeded
- ReplSet#event:commandFailed
Returns:
ReplSet instance.Events
- 
    
    
    ReplSet close event Type:- object
 
- 
    commandFailed
- 
    
    
    An event emitted indicating a command failed, if command monitoring is enabled Type:- object
 
- 
    commandStarted
- 
    
    
    An event emitted indicating a command was started, if command monitoring is enabled Type:- object
 
- 
    commandSucceeded
- 
    
    
    An event emitted indicating a command succeeded, if command monitoring is enabled Type:- object
 
- 
    connect
- 
    
    
    A replset connect event, used to verify that the connection is up and running Type:
- 
    
    
    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 typestring The stage in the high availability event (start|end) data.norepeatboolean This is a repeating high availability process or a single execution only data.idnumber The id for this high availability request data.stateobject An object containing the information about the current replicaset 
- 
    joined
- 
    
    
    A server member joined the replicaset Type:- function
 Name Type Description typestring The type of member that joined (primary|secondary|arbiter) serverServer The server object that joined 
- 
    
    
    A server member left the replicaset Type:- function
 Name Type Description typestring The type of member that left (primary|secondary|arbiter) serverServer The server object that left 
- 
    
    
    ReplSet open event, emitted when replicaset can start processing commands. Type:- Replset
 
- 
    parseError
- 
    
    
    ReplSet parseError event Type:- object
 
- 
    timeout
- 
    
    
    ReplSet timeout event Type:- object