batch
The method allows to perform batch operations. It’s available as an extension that you import separately:
The method accepts the database instance as the argument and returns a batch wrapper.
API
All batch wrapper collections have altered methods available:
set
- sets a documentupdate
- updates a documentupset
- sets or updates a document if it existsremove
- removes a document
Unlike the regular methods, batch methods are synchronous and return void
:
$()
The returned batch wrapper also acts as a function that commits the batch operation:
It returns Promise<void>
.