How to do transaction/locking in mongodb?
Answer / Anju Upadhyay
MongoDB supports multi-document transactions starting from MongoDB 4.0, but it does not support row-level locking as seen in traditional relational databases.nTo perform a multi-document transaction, you can use the beginTransaction and commitTransaction methods within a session. The isolation level is set to snapshot isolation by default, which ensures that transactions see a consistent snapshot of data during their execution.nFor better concurrency control, you can also implement optimistic locking using versioning or timestamp fields in your documents.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is mongodb sharding?
How do I drop a collection in mongodb? Write it's syntax
List some alternatives to mongodb?
Can you create an index on an array field in mongodb? If yes, what happens in this case?
When did mongodb go public?
What is skip() method?
Write the syntax for creating a collection and dropping a collection in mongodb.
What is the default port of mongodb server?
What do you mean by a replica set in mongodb?
What is difference between mongod and mongodb?
Is mongodb support null values?
How to install mongodb on our machine?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)