On this page
Removes the member described by the
hostnameparameter from the current replica set. This function will disconnect the shell briefly and forces a reconnection as the replica set renegotiates which member will be primary. As a result, the shell will display an error even if this command succeeds.
rs.remove()method has the following parameter:
Parameter Type Description
string The hostname of a system in the replica set.
Before running the
rs.remove()operation, it is good practice to shut down the replica set member that you are removing.