MCPcopy
hub / github.com/directus/directus / deleteOne

Method deleteOne

api/src/services/items.ts:1099–1105  ·  view source on GitHub ↗

* Delete a single item by primary key. * * Uses `this.deleteMany` under the hood.

(key: PrimaryKey, opts?: MutationOptions)

Source from the content-addressed store, hash-verified

1097 * Uses `this.deleteMany` under the hood.
1098 */
1099 async deleteOne(key: PrimaryKey, opts?: MutationOptions): Promise<PrimaryKey> {
1100 const primaryKeyField = this.schema.collections[this.collection]!.primary;
1101 validateKeys(this.schema, this.collection, primaryKeyField, key);
1102
1103 await this.deleteMany([key], opts);
1104 return key;
1105 }
1106
1107 /**
1108 * Delete multiple items by primary key.

Callers 5

deleteOneMethod · 0.95
createMethod · 0.95
removeMethod · 0.95
onUploadFinishFunction · 0.95
onMessageMethod · 0.95

Calls 2

deleteManyMethod · 0.95
validateKeysFunction · 0.85

Tested by

no test coverage detected