Initiates a replica set. Optionally takes a configuration argument in the form of a document that holds the configuration of a replica set.

The rs.initiate() method has the following parameter:

Parameter Type Description
configuration document Optional. A document that specifies configuration settings for the new replica set. If a configuration is not specified, MongoDB uses a default configuration.

The rs.initiate() method provides a wrapper around the “replSetInitiatedatabase command.

Replica Set Configuration

See Member Configuration Tutorials and Replica Set Configuration for examples of replica set configuration and invitation objects.

Was this page helpful?

Yes No

Thank you for your feedback!

We're sorry! You can Report a Problem to help us improve this page.