Bulk Queries
Bulk Queries are optimised to do large numbers of database operations fast.
If you need to insert, update or delete many rows at once it's recommended to use Bulk Queries.
Because Bulk Queries have no overhead they are very fast and are executed directly on the database. Bulk Queries only work in Cloud Code.
When to use:
If you need to run fast queries on the database without triggering Live Queries or Triggers.
When not to use:
If you need Live-Queries or Triggers to work as a result of these queries.
Bulk Write
Inserts one or several objects into a Class.
Options:
className
: Class name in which you want to insert rowsrows:
Array of rows to be inserted, each row needs to haveupdate
object containing the column data
Bulk Update
Updates one or several columns on the first found object for each filter.
Options:
className
: Class name in which you want to insert rowsfilters:
Array of updates to make, each update needs to specifyfilter
andupdate
objects. The former is specifying which column to base the selection on and the latter is specifying which column to update in the selection.
Note: this query expects always the filter to return 1 row for each update, if multiple rows are returned only the first one will be updated.
Bulk Update Many
Updates one or several columns on all found objects for each filter.
Options:
className
: Class name in which you want to insert rowsfilters:
Array of updates to make, each update needs to specifyfilter
andupdate
objects. The former is specifying which column to base the selection on and the latter is specifying which column to update in the selection.
Bulk Delete
Deletes the first found object for each filter.
Options:
className
: Class name in which you want to insert rowsfilters:
Array of updates to make, each update needs to specifyfilter
andupdate
objects. The former is specifying which column to base the selection on and the latter is specifying which column to update in the selection.
Note: this query expects always the filter to return 1 row for each update, if multiple rows are returned only the first one will be deleted.
Bulk Delete Many
Deletes all objects found for each filter.
Options:
className
: Class name in which you want to insert rowsfilters:
Array of updates to make, each update needs to specifyfilter
andupdate
objects. The former is specifying which column to base the selection on and the latter is specifying which column to update in the selection.
Last updated