3

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?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Paritosh Singh
  • 6,288
  • 5
  • 37
  • 56

1 Answers1

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