Complete the code to create a replica set member in MongoDB configuration.
{ _id: 0, host: "localhost:27017", [1]: true }The arbiterOnly field is used to specify if the member is an arbiter in the replica set, which helps in elections but does not hold data.
Complete the command to check the status of a MongoDB replica set.
rs.[1]()The rs.status() command shows the current status of the replica set members.
Fix the error in the command to add a new member to the replica set.
rs.add({ host: "localhost:[1]" })Replica set members must run on different ports. The default port is 27017, so a new member should use a different port like 27018.
Fill both blanks to complete the MongoDB replica set initiation command with a name and members.
rs.initiate({ _id: [1], members: [ { _id: 0, host: [2] } ] })The replica set name is a string like "rs0". The host must be a string with hostname and port, e.g., "localhost:27017".
Fill all three blanks to create a MongoDB replica set member with priority and votes settings.
{ _id: [1], host: [2], priority: [3] }The member _id is usually 1 or another integer. The host is a string with hostname and port. Priority is a number indicating election priority.