rs.conf()

Definition

  • rs.conf()
  • Returns a document that contains the current replica setconfiguration.

The method wraps the replSetGetConfig command.

Output Example

The following document provides a representation of a replica setconfiguration document. The configuration of your replica set mayinclude only a subset of these settings:

  1. {
  2. _id: <string>,
  3. version: <int>,
  4. protocolVersion: <number>,
  5. writeConcernMajorityJournalDefault: <boolean>,
  6. configsvr: <boolean>,
  7. members: [
  8. {
  9. _id: <int>,
  10. host: <string>,
  11. arbiterOnly: <boolean>,
  12. buildIndexes: <boolean>,
  13. hidden: <boolean>,
  14. priority: <number>,
  15. tags: <document>,
  16. slaveDelay: <int>,
  17. votes: <number>
  18. },
  19. ...
  20. ],
  21. settings: {
  22. chainingAllowed : <boolean>,
  23. heartbeatIntervalMillis : <int>,
  24. heartbeatTimeoutSecs: <int>,
  25. electionTimeoutMillis : <int>,
  26. catchUpTimeoutMillis : <int>,
  27. getLastErrorModes : <document>,
  28. getLastErrorDefaults : <document>,
  29. replicaSetId: <ObjectId>
  30. }
  31. }

For description of the configuration settings, seeReplica Set Configuration.