Starting from which MongoDB version can you run multi-document ACID transactions on a replica set?
- a3.6
- b4.0✓
- c4.2
- d5.0
Explanation:MongoDB 4.0 introduced multi-document ACID transactions for replica sets. Sharded cluster support followed in 4.2.
75 verified Database Mongodb Transactions Consistency interview questions — solve with answers, learn from explanations, test yourself in a real simulation.
Try the real simulation →ClientSession with startTransaction(), operations run through that session's database handle, and commitTransaction() finalizes them. There is no per-collection beginTransaction/endTransaction API.local: it returns the most recent data available on the node the query hits, without guaranteeing majority acknowledgment.majority returns a document. What does that guarantee about the document?w: 1 and is guaranteed durable on the primary onlymajority returns majority-committed data, meaning it won't be rolled back by a later election. This does not mean the original write used w: "majority"; even a write acknowledged with w: 1 can later reach the majority-commit point.insertOne() against a replica set when no write concern was configured?w: 1✓w: majorityw: 0w: allw: 1: acknowledgment did not wait for replication to secondaries. Starting in MongoDB 5.0, the implicit default is w: "majority" for most replica-set topologies (with an exception for certain arbiter-containing topologies), so the version qualifier matters.Test yourself against the 2475-question Database bank.
Start interview