Complete the code to start a transaction with a read concern of 'majority'.
const session = client.startSession();
session.startTransaction({ readConcern: { level: '[1]' } });The read concern 'majority' ensures the transaction reads data that has been acknowledged by a majority of replica set members.
Complete the code to set the write concern to 'w: 1' in a transaction.
session.startTransaction({ writeConcern: { w: [1] } });Write concern 'w: 1' means the write must be acknowledged by the primary node only.
Fix the error in the transaction options to correctly specify read concern level.
session.startTransaction({ readConcern: { level: '[1]' } });The read concern level must be exactly 'majority' in lowercase.
Fill both blanks to start a transaction with read concern 'snapshot' and write concern 'majority'.
session.startTransaction({ readConcern: { level: '[1]' }, writeConcern: { w: '[2]' } });Read concern 'snapshot' provides a consistent view of data during the transaction. Write concern 'majority' ensures writes are acknowledged by most nodes.
Fill all three blanks to start a transaction with read concern 'local', write concern '1', and specify a max commit time of 1000 milliseconds.
session.startTransaction({ readConcern: { level: '[1]' }, writeConcern: { w: '[2]' }, maxCommitTimeMS: [3] });This transaction uses read concern 'local' for reading the node's data, write concern '1' for primary acknowledgment, and sets a max commit time of 1000 milliseconds to limit commit duration.