githubEdit

Delete Many

Deletes all the documents by a specified filter.

Use this API action when you request the mass deletion of your collection documents. You can set a filter to delete some portions of documents.

[DeleteMany] - Deletes all the documents by a specified filter.

delete

Use this API action when you request the mass deletion of your collection documents. You can set a filter to delete some portions of documents. https://docs.codemash.io/api/database/collections/delete-many

Authorizations
AuthorizationstringRequired
Path parameters
CollectionNamestringRequired

Collection name - unique, lowercased, collection name without whitespace. E.g., if your collection title you have entered in the CodeMash dashboard is "Business Trips" then collection name would be "business-trips".

versionstringRequired

The CodeMash API version used to fetch data from the API. If not specified, the last version will be used. E.g.: v2

Header parameters
Acceptstring Β· enumRequired

Accept Header

Possible values:
X-CM-ClusterstringOptional

API key of your cluster. Can be passed in a header as X-CM-Cluster.

X-CM-ProjectIdstringRequired

ID of your project. Can be passed in a header as X-CM-ProjectId.

CultureCodestringOptional

Specify culture code when your response from the API should be localised. E.g.: en

Body
FilterstringOptional

Deletes all the documents by a specified filter (in JSON format).

IgnoreTriggersbooleanOptional

Ignore the delete trigger when executing mass deletion. When this property is set to "true", all delete triggers won't be executed.

Responses
chevron-right
200

Success

application/json
delete
/{version}/db/{CollectionName}/bulk
200

Success

var client = new CodeMashClient(apiKey, projectId);
var service = new CodeMashRepository<Person>(client);

await service.DeleteManyAsync(
    x => x.Name == "John"
);
circle-info

Check the information about entities on how your filter parameters are mapped.

Last updated