I have worked in a mongodb, which is no sql database and it support document level locks only. As firestore is also no sql database, does it support document level locks or it allows collection level locks?
Asked
Active
Viewed 602 times
3
-
Are you asking about Realtime Database (which doesn't have documents) or Firestore (which does have documents)? – Doug Stevenson Oct 17 '18 at 18:38
-
@DougStevenson My bad, question is for firestore. – Paritosh Singh Oct 18 '18 at 03:51
1 Answers
3
The only operation you have for locking is document locking with transactions. There is no collection locking in Firestore.

Doug Stevenson
- 297,357
- 32
- 422
- 441
-
What about creating a document in another collection (let's call it the document D in the collection B) that represents this collection (collection A). If we build our system in a way that every time we update collection A we do it with a transaction that holds a lock to the document D (and we also perform required reads to collection A inside the transaction), would it behave like a collection level lock? – josue.0 Jul 14 '22 at 17:59