- Reference >
- Database Commands >
- Replication Commands >
- replSetGetConfig
replSetGetConfig¶
On this page
Definition¶
-
replSetGetConfig
¶ Returns a document that describes the current configuration of the replica set.
Syntax¶
To run, replSetGetConfig
must be issued against the
admin
database and has the following syntax:
Field | Type | Description |
---|---|---|
replSetGetConfig |
any | Any value |
commitmentStatus | boolean | Optional. Specify You can only specify New in version 4.4. |
comment |
any | Optional. A user-provided comment to attach to this command. Once set, this comment appears alongside records of this command in the following locations:
A comment can be any valid BSON type (string, integer, object, array, etc). New in version 4.4. |
The mongo
shell provides the rs.conf()
method
that wraps the replSetGetConfig
command:
Output Example¶
The following is an example output of the replSetGetConfig
command run with commitmentStatus: true on the primary:
config |
The replica set configuration. For description of each configuration settings, see Replica Set Configuration. |
commitmentStatus | A boolean that indicates whether the most recent replica set configuration has been committed; i.e.
If If |
ok |
A number that indicates whether the command has succeeded (1 ) or
failed (0 ). |
operationTime $clusterTime |
Returned with every command for a replica set. See db.adminCommand Response for details. |
See also