Platform Manual
CRUD Operations
Best Practices for CRUD
The following snippet demonstrates a batch operation in which two write transactions are contained in a single transaction enclosure:
The following snippet shows an example of the writeStrategy: insertDefaultIfAbsent parameter passed as an argument to theupsert method:
For example, use DispatchQueue.global, as follows:
The following snippet demonstrates a queued write transaction that has the potential to create a deadlock situation. This is because the write transaction initiated on the "people" collection, along with its nested write transaction on the "settings" collection both attempt to acquire resources held by the other:
Updated 11 Mar 2024
Did this page help you?