0
0
MongoDBquery~10 mins

Why replication is needed in MongoDB - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a replica set member in MongoDB configuration.

MongoDB
{ _id: 0, host: "localhost:27017", [1]: true }
Drag options to blanks, or click blank then click option'
AarbiterOnly
Bhidden
Cvotes
Dpriority
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing 'priority' with arbiterOnly.
Using 'votes' instead of arbiterOnly.
2fill in blank
medium

Complete the command to check the status of a MongoDB replica set.

MongoDB
rs.[1]()
Drag options to blanks, or click blank then click option'
Aconfig
Bstatus
CisMaster
Dreconfig
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'config' instead of 'status'.
Trying 'isMaster' which shows primary info but not full status.
3fill in blank
hard

Fix the error in the command to add a new member to the replica set.

MongoDB
rs.add({ host: "localhost:[1]" })
Drag options to blanks, or click blank then click option'
A27018
B27017
C28017
D27016
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same port 27017 for multiple members.
Choosing a port outside the typical MongoDB range.
4fill in blank
hard

Fill both blanks to complete the MongoDB replica set initiation command with a name and members.

MongoDB
rs.initiate({ _id: [1], members: [ { _id: 0, host: [2] } ] })
Drag options to blanks, or click blank then click option'
A"rs0"
B"localhost:27017"
C"myReplicaSet"
D"127.0.0.1:27017"
Attempts:
3 left
💡 Hint
Common Mistakes
Using IP address instead of hostname.
Not quoting the replica set name.
5fill in blank
hard

Fill all three blanks to create a MongoDB replica set member with priority and votes settings.

MongoDB
{ _id: [1], host: [2], priority: [3] }
Drag options to blanks, or click blank then click option'
A1
B"localhost:27018"
C2
D"localhost:27017"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string for _id instead of integer.
Setting priority as string instead of number.