Skip to main content
Glama

MongoDB MCP Server

Official
by mongodb-js
Apache 2.0
9,553
581
  • Apple
  • Linux

export

Extract MongoDB collection data or query results in EJSON format. Specify filters, projections, sorting, and export format to customize data retrieval for analysis or migration.

Instructions

Export a collection data or query results in the specified EJSON format.

Input Schema

NameRequiredDescriptionDefault
collectionYesCollection name
databaseYesDatabase name
exportTitleYesA short description to uniquely identify the export.
filterNoThe query filter, matching the syntax of the query argument of db.collection.find()
jsonExportFormatNoThe format to be used when exporting collection data as EJSON with default being relaxed. relaxed: A string format that emphasizes readability and interoperability at the expense of type preservation. That is, conversion from relaxed format to BSON can lose type information. canonical: A string format that emphasizes type preservation at the expense of readability and interoperability. That is, conversion from canonical to BSON will generally preserve type information except in certain specific cases.relaxed
limitNoThe maximum number of documents to return
projectionNoThe projection, matching the syntax of the projection argument of db.collection.find()
sortNoA document, describing the sort order, matching the syntax of the sort argument of cursor.sort(). The keys of the object are the fields to sort on, while the values are the sort directions (1 for ascending, -1 for descending).

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "collection": { "description": "Collection name", "type": "string" }, "database": { "description": "Database name", "type": "string" }, "exportTitle": { "description": "A short description to uniquely identify the export.", "type": "string" }, "filter": { "additionalProperties": true, "description": "The query filter, matching the syntax of the query argument of db.collection.find()", "properties": {}, "type": "object" }, "jsonExportFormat": { "default": "relaxed", "description": "The format to be used when exporting collection data as EJSON with default being relaxed.\nrelaxed: A string format that emphasizes readability and interoperability at the expense of type preservation. That is, conversion from relaxed format to BSON can lose type information.\ncanonical: A string format that emphasizes type preservation at the expense of readability and interoperability. That is, conversion from canonical to BSON will generally preserve type information except in certain specific cases.", "enum": [ "relaxed", "canonical" ], "type": "string" }, "limit": { "description": "The maximum number of documents to return", "type": "number" }, "projection": { "additionalProperties": true, "description": "The projection, matching the syntax of the projection argument of db.collection.find()", "properties": {}, "type": "object" }, "sort": { "additionalProperties": {}, "description": "A document, describing the sort order, matching the syntax of the sort argument of cursor.sort(). The keys of the object are the fields to sort on, while the values are the sort directions (1 for ascending, -1 for descending).", "properties": {}, "type": "object" } }, "required": [ "exportTitle", "database", "collection" ], "type": "object" }

Other Tools from MongoDB MCP Server

Related Tools

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mongodb-js/mongodb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server