MongoDB Replication CommandMongoDB isMaster CommandThe role of the mongod instance is described by the document returned by the isMaster command. To create a specific user's credentials, an array of SASL mechanisms has been used. It is returned when saslSupportMechs is specified as an optional field. The isMaster command returns a subset of replica set if the instance is a member of the replica set. isMaster command returns the associated information when sent to a mongod instance, which isn't a member of the replica set. Syntax: MongoDB replySetAbortPrimaryCatchUp commandThe command forces the specified primary member of the replica set to end sync then complete the transition to primary member. Syntax: MongoDB replSetGetConfig commandThe command returns a document that specify the current configuration of the replica set. To fetch the command directly we have to use the following operation: Syntax: For Example - We have a document that represent a replica set configuration. It may include only a subset of the following settings: MongoDB replSetInitiate commandThe replSetInitiative command used to initializr a new replica set. Syntax: Example to pass the document to the rs.initiate(), helper: MongoDB replSetGetStatus commandThe command returns the status to the replica set. It returns it from the server, which is used to process the document. The data returned by this command derives from data included in the signal sent to the server by other members of the set. Syntax: Example: Output Next TopicMongoDB Sharding Commands |