Skip to main content

Batch Delete Documents

POST 

/collections/:collectionName/documents/remove

Delete documents matching the query conditions. Uses POST method because complex query conditions need to be passed in the request body. The query cannot be an empty object (to prevent accidental deletion of all data). Non-admin users will have _openid conditions automatically injected.

Request

Path Parameters

    collectionName stringrequired

    Collection name

Body

required
    query objectrequired

    Query conditions (EJSON object, cannot be empty)

    multi boolean

    Whether to delete multiple documents

    transactionId string

    Transaction ID

Responses

Delete successful

Schema
    deleted integer

    Number of deleted documents

Loading...