Skip to main content

Home > git-documentdb > Collection > delete

Collection.delete() method#

Delete a document by _id property in JsonDoc

Signature:
delete(jsonDoc: JsonDoc, options?: DeleteOptions): Promise<DeleteResultJsonDoc>;

Parameters#

ParameterTypeDescription
jsonDocJsonDocJsonDoc whose _id is shortId. Only the _id property is referenced. shortId is a file path whose collectionPath and extension are omitted.
optionsDeleteOptions
Returns:

Promise<DeleteResultJsonDoc >

Exceptions#

Err.UndefinedDocumentIdError

Err.DatabaseClosingError

Err.TaskCancelError

# Errors from deleteWorker