Skip to main content

Parameters

The deleteRecords() method object can contain the following properties:

ParameterTypeRequiredDescription
tablestringYesThe name of the table to delete records from.
whereRecord<string, any> | Record<string, any>[]NoA filter object or array of objects used to identify the records for deletion. Omit only when using options.allowAll: true.
optionsDeleteRecordsOptionsNoConfiguration flags that control the behaviour of the deletion.
withRecord<string, DeleteNestedRecord>NoAn object specifying related tables from which to delete records simultaneously. See Multi-Table Delete.

Delete records options

OptionTypeDefaultDescription
softDeletebooleanfalseIf true, the records are not hard deleted, but marked as deleted by setting the deletedAt timestamp to the current time.
transactionalbooleanfalseIf true, the deletion is treated as a single transaction; all matching records must be deleted, or all fail.
chunkSizenumber1000The batch size for processing large deletions.
dryRunbooleanfalseSimulates the delete operation and returns the list of records that would have been deleted without modifying the database.
allowAllbooleanfalseRequired to delete all records in a table when the where parameter is omitted. This is a safety measure.