Options for the Binary across all instances
Options for individual instances
TMPDIR for the keyfile, when auth is used
Options for the Replset itself and defaults for instances
All servers this ReplSet instance manages
Sets or gets the default captureRejection value for all emitters.
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
Get & Set "binaryOpts"
Get & Set "binaryOpts"
Get & Set "instanceOpts"
Get & Set "instanceOpts"
Get & Set "replSetOpts" (Applies defaults)
Get & Set "replSetOpts" (Applies defaults)
Get Current state of this class
Connects to the first server from the list of servers and issues the replSetInitiate
command passing in a new replica set configuration object.
Create the one Instance (without starting them)
Instance Options to use for this instance
Wait until the replSet has elected a Primary
Timeout to not run infinitly, default: 30s
Extra Parameter for logging to know where this function was called
Remove the defined dbPath's
Remove the dbPath even if it is no "tmpDir" (and re-check if tmpDir actually removed it)
Remove the defined dbPath's
Set how to run a cleanup, by default { doCleanup: true }
is used
Helper function to determine if "auth" should be enabled This function expectes to be run after the auth object has been transformed to a object
"true" when "auth" should be enabled
Ensure "_keyfiletmp" is defined
the ensured "_keyfiletmp" value
Returns instance options suitable for a MongoMemoryServer.
Options to merge with
The Keyfile location if "auth" is used
Returns an mongodb URI that is setup with all replSet servers
add an database into the uri (in mongodb its the auth database, in mongoose its the default database for models)
change the ip in the generated uri, default will otherwise always be "127.0.0.1"
an valid mongo URI, by the definition of https://docs.mongodb.com/manual/reference/connection-string/
Initialize & start all servers in the replSet
Start underlying mongod
instances.
Change "this._state" to "newState" and emit "newState"
The new State to set & emit
Stop the underlying mongod
instance(s).
run "this.cleanup"? (remove dbPath & reset "instanceInfo")
Stop the underlying mongod
instance(s).
Set how to run ".cleanup", by default only { doCleanup: true }
is used
Wait until all instances are running
Create an instance of "MongoMemoryReplSet" and call start
Options for the ReplSet
Generated using TypeDoc
Class for managing an replSet