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 do you mean by a replica set in mongodb?
Why is mongodb so popular?
Does an update fsync to disk immediately?
How to convert string to objectid in mongoose?
How to insert data into mongodb using mongoose?
Is mongodb compass free?
Explain what is mongodb?
Where are mongodb databases stored?
List some alternatives to mongodb?
What is difference between hadoop and mongodb?
How much ram do I need for mongodb?
Mention what is the basic syntax to use index in mongodb?
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)