Whether mongodb is restricted by write locks when operating multiple connections

mongodb implements document locking. When a document is updated, a write lock is created on the updated document, and the document cannot be read or modified at the same time.

if mongodb connection pool establishes multiple connections, multiple requests come through multiple connections of mongodb, and manipulates the same document in the database collection at the same time, if the first preemptive mogno connection starts to modify the document and establishes a document-level write lock, then other mongo connections should no longer be able to modify and read the document at the same time until the first connection releases the write lock on the document. In the case of multiple connections, is the write lock of mongodb like this?

there is another problem. Mongodb"s current read locks should only be document-level read locks, right? In the case of document-level read locks, other connections to mongo can modify other documents under this collection at the same time, right?

Jan.19,2022
Menu