Complete the code to initiate a replica set with the name 'rs0'.
rs.initiate({ _id: [1], members: [{ _id: 0, host: "localhost:27017" }] })The replica set name must be a string, so it should be enclosed in quotes.
Complete the code to add a second member to the replica set with host 'localhost:27018'.
rs.initiate({ _id: "rs0", members: [{ _id: 0, host: "localhost:27017" }, { _id: [1], host: "localhost:27018" }] })Member _id values must be unique integers starting from 0.
Fix the error in the code to correctly configure the priority of the first member to 2.
rs.initiate({ _id: "rs0", members: [{ _id: 0, host: "localhost:27017", priority: [1] }] })The priority value must be a number without quotes.
Fill both blanks to configure a hidden member with _id 2 and host 'localhost:27019'.
rs.initiate({ _id: "rs0", members: [{ _id: 0, host: "localhost:27017" }, { _id: 1, host: "localhost:27018" }, { _id: [1], host: [2], hidden: true }] })The hidden member should have _id 2 and the correct host string.
Fill all three blanks to configure an arbiter with _id 3, host 'localhost:27020', and votes set to 1.
rs.initiate({ _id: "rs0", members: [{ _id: 0, host: "localhost:27017" }, { _id: 1, host: "localhost:27018" }, { _id: 2, host: "localhost:27019", hidden: true }, { _id: [1], host: [2], arbiterOnly: true, votes: [3] }] })The arbiter must have a unique _id 3, the correct host string, and votes set to 1.