* Delete multiple items by query. * * Uses `this.deleteMany` under the hood.
(query: Query, opts?: MutationOptions)
| 1083 | * Uses `this.deleteMany` under the hood. |
| 1084 | */ |
| 1085 | async deleteByQuery(query: Query, opts?: MutationOptions): Promise<PrimaryKey[]> { |
| 1086 | const keys = await this.getKeysByQuery(query); |
| 1087 | |
| 1088 | const primaryKeyField = this.schema.collections[this.collection]!.primary; |
| 1089 | validateKeys(this.schema, this.collection, primaryKeyField, keys); |
| 1090 | |
| 1091 | return keys.length ? await this.deleteMany(keys, opts) : []; |
| 1092 | } |
| 1093 | |
| 1094 | /** |
| 1095 | * Delete a single item by primary key. |
no test coverage detected