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 |
Is it required to call ‘getlasterror’ to make a write durable?
What is odm in mongodb?
Which language is used in mongodb?
How do I do transactions/locking in mongodb?
Compare mongodb and couchdb at high level?
Can you edit long shell operations with an external text editor?
What is difference between mongodb and dynamodb?
If you remove an object attribute, is it deleted from the database?
What is a table called in mongodb?
When an object attribute is removed, is it deleted from the store?
Can journaling features be used to perform safe hot backups?
Is mongodb object oriented?
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)