Files
wehub-resource-sync e04ed9c211
CF: Deploy Dev Docs / deploy (push) Has been cancelled
Sync Labels / build (push) Has been cancelled
tests / unit tests (macos-latest) (push) Has been cancelled
tests / unit tests (windows-latest) (push) Has been cancelled
tests / unit tests (ubuntu-latest) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:32:45 +08:00

2.7 KiB

title, type, weight, description
title type weight description
mongodb-delete-one docs 1 A "mongodb-delete-one" tool deletes a single document from a MongoDB collection.

About

The mongodb-delete-one tool performs a destructive operation, deleting the first single document that matches a specified filter from a MongoDB collection.

If the filter matches multiple documents, only the first one found by the database will be deleted. This tool is useful for removing specific entries, such as a user account or a single item from an inventory based on a unique ID.

The tool returns the number of documents deleted, which will be either 1 if a document was found and deleted, or 0 if no matching document was found.

Compatible Sources

{{< compatible-sources >}}


Example

Here is an example that deletes a specific user account from the users collection by matching their unique email address. This is a permanent action.

kind: tool
name: delete_user_account
type: mongodb-delete-one
source: my-mongo-source
description: Permanently deletes a user account by their email address.
database: user_data
collection: users
filterPayload: |
    { "email": {{json .email_address}} }
filterParams:
  - name: email_address
    type: string
    description: The email of the user account to delete.

Reference

field type required description
type string true Must be mongodb-delete-one.
source string true The name of the mongodb source to use.
description string true A description of the tool that is passed to the LLM.
database string true The name of the MongoDB database containing the collection.
collection string true The name of the MongoDB collection from which to delete a document.
filterPayload string true The MongoDB query filter document to select the document for deletion. Uses {{json .param_name}} for templating.
filterParams list false A list of parameter objects that define the variables used in the filterPayload.