Complete the code to set the read concern level to local in a MongoDB query.
db.collection.find().readConcern('[1]')
The local read concern returns the most recent data available on the node without waiting for replication.
Complete the code to set the read concern level to majority in a MongoDB query.
db.collection.find().readConcern('[1]')
The majority read concern ensures that the data read has been acknowledged by a majority of replica set members.
Fix the error in the code to use the snapshot read concern correctly.
db.collection.find().readConcern('[1]')
The snapshot read concern provides a point-in-time snapshot of the data for transactions and causal consistency.
Fill both blanks to set the read concern to majority and specify the read preference to primary.
db.collection.find().readConcern('[1]').readPreference('[2]')
Setting readConcern to majority ensures data is confirmed by most nodes. Setting readPreference to primary reads from the primary node.
Fill all three blanks to set a snapshot read concern, read from primary, and limit results to 5 documents.
db.collection.find().readConcern('[1]').readPreference('[2]').limit([3])
This code sets the read concern to snapshot for consistent reads, reads from the primary node, and limits the output to 5 documents.