Skip to main content
Server path: /mongodb | Type: Application | PCID required: Yes MongoDB API

Tools

ToolDescription
mongodb_findFind multiple documents in a MongoDB collection matching the given filter. Returns an array of documents.
mongodb_find_oneFind a single document in a MongoDB collection matching the given filter. Returns the first matched document or null.
mongodb_insert_oneInsert a single document into a MongoDB collection.
mongodb_insert_manyInsert multiple documents into a MongoDB collection in a single operation.
mongodb_update_oneUpdate the first document in a MongoDB collection that matches the filter. Use MongoDB update operators like set,set, unset, inc,inc, push.
mongodb_update_manyUpdate all documents in a MongoDB collection that match the filter. Use MongoDB update operators like set,set, unset, inc,inc, push.
mongodb_delete_oneDelete the first document in a MongoDB collection that matches the filter.
mongodb_delete_manyDelete all documents in a MongoDB collection that match the filter.
mongodb_aggregateExecute an aggregation pipeline on a MongoDB collection. Supports read-only stages such as match,match, group, sort,sort, project, lookup,lookup, unwind, limit,andlimit, and skip. Note: outandout and merge stages write data to collections and should be used with caution.
mongodb_count_documentsCount the number of documents in a MongoDB collection matching the given filter.
mongodb_list_collectionsList all collections in the connected MongoDB database.
mongodb_describe_collectionInfer the schema of a MongoDB collection by sampling documents. Returns field names and their detected BSON types.
mongodb_get_infoGet information about the connected MongoDB database.

mongodb_find

Find multiple documents in a MongoDB collection matching the given filter. Returns an array of documents. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
filterobjectNoMongoDB query filter (e.g. { “status”: “active”, “age”: { “$gt”: 18 } })
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_find_one

Find a single document in a MongoDB collection matching the given filter. Returns the first matched document or null. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
filterobjectNoMongoDB query filter (e.g. { “status”: “active”, “age”: { “$gt”: 18 } })
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_insert_one

Insert a single document into a MongoDB collection. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
documentobjectYesDocument to insert as a key-value object
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_insert_many

Insert multiple documents into a MongoDB collection in a single operation. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
documentsobject[]YesArray of documents to insert
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_update_one

Update the first document in a MongoDB collection that matches the filter. Use MongoDB update operators like set,set, unset, inc,inc, push. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
filterobjectYesFilter to identify the document to update
updateobjectYesMongoDB update document using update operators (e.g. { “set": { "field": "value" }, "inc”: { “count”: 1 } })
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_update_many

Update all documents in a MongoDB collection that match the filter. Use MongoDB update operators like set,set, unset, inc,inc, push. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
filteranyYesFilter to identify documents to update. Must contain at least one condition; use mongodb_find first to verify scope.
updateobjectYesMongoDB update document using update operators (e.g. { “set": { "field": "value" }, "inc”: { “count”: 1 } })
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_delete_one

Delete the first document in a MongoDB collection that matches the filter. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
filterobjectYesFilter to identify the document to delete
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_delete_many

Delete all documents in a MongoDB collection that match the filter. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
filteranyYesFilter to identify documents to delete. Must contain at least one condition; use mongodb_find first to verify scope.
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_aggregate

Execute an aggregation pipeline on a MongoDB collection. Supports read-only stages such as match,match, group, sort,sort, project, lookup,lookup, unwind, limit,andlimit, and skip. Note: outandout and merge stages write data to collections and should be used with caution. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
pipelineobject[]YesAggregation pipeline stages (e.g. [{ “match": { "status": "active" } }, { "group”: { “_id”: “category", "total": { "sum”: 1 } } }])
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_count_documents

Count the number of documents in a MongoDB collection matching the given filter. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name
filterobjectNoMongoDB query filter (e.g. { “status”: “active”, “age”: { “$gt”: 18 } })
optionsobjectNoAdditional MongoDB operation options (e.g. { “limit”: 10, “sort”: { “name”: 1 } })

mongodb_list_collections

List all collections in the connected MongoDB database.

mongodb_describe_collection

Infer the schema of a MongoDB collection by sampling documents. Returns field names and their detected BSON types. Parameters:
ParameterTypeRequiredDefaultDescription
collectionstringYesCollection name to inspect

mongodb_get_info

Get information about the connected MongoDB database.