MongoDB Documentation, Release 3.0.4 the _id field in this case. Finally, the members document must declare the host value. All other fields are optional. To add a member with the following configuration: Example Issue the following: rs.add({_id: 1, host: "mongodb3.example.net:27017", priority: 0, hidden: true }) To remove a member of a replica set use either of the following procedures. To remove a member you can manually edit the replica set configuration document (page 652), as described here. Remove Members from Replica Set Remove a Member Using rs.remove() Remove a Member Using rs.reconfig() Example • an _id of 1 . • a hostname and port number of mongodb3.example.net:27017 . • a priority value within the replica set of 0 . • a configuration as hidden , 1. Shut down the mongod instance for the member you wish to remove. To shut down the instance, connect using the mongo shell and the db.shutdownServer() method. 2. Connect to the replica set’s current primary . To determine the current primary, use db.isMaster() while connected to any member of the replica set. 3. Use rs.remove() in either of the following forms to remove the member: rs.remove("mongod3.example.net:27017") rs.remove("mongod3.example.net") 1. Shut down the mongod instance for the member you wish to remove. To shut down the instance, connect using the mongo shell and the db.shutdownServer() method. 2. Connect to the replica set’s current primary . To determine the current primary, use db.isMaster() while connected to any member of the replica set. 3. Issue the rs.conf() method to view the current configuration document and determine the position in the members array of the member to remove: mongod_C.example.net is in position 2 of the following configuration file: 618 Chapter 9. Replication MongoDB disconnects the shell briefly as the replica set elects a new primary. The shell then automatically reconnects. The shell displays a DBClientCursor::init call() failed error even though the com- mand succeeds.