← All procedures
mongo.database.info
Get database information and statistics
MCPCLI- Package
- @procedures/mongo · README
- Path
["mongo","database","info"]- CLI
mark mongo database info- MCP tool
mongo.database.info on the dev-tools server- As data
{"$proc":["mongo","database","info"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/mongo"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["mongo","database","info"], {});
console.log(JSON.stringify(result));From the command line
$ mark mongo database info
As data, in a program
{ "$proc": ["mongo", "database", "info"], "input": {} }Input
| Field | Type | Required | Default | Description |
|---|
collection | string | no | | The collection name. It takes the place of metadata.collection. |
database | string | no | | The database name (default: the database of the connection) |
Output
| Field | Type | Required | Default | Description |
|---|
name | string | yes | | The database name |
collections | number | yes | | The number of collections (views not counted) |
views | number | yes | | The number of views |
sizeOnDisk | number | yes | | The data size, in bytes |
empty | boolean | yes | | True when the database has no collections |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"collection": {
"description": "The collection name. It takes the place of metadata.collection.",
"type": "string",
"minLength": 1
},
"database": {
"description": "The database name (default: the database of the connection)",
"type": "string",
"minLength": 1
}
}
},
"output": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The database name"
},
"collections": {
"type": "number",
"description": "The number of collections (views not counted)"
},
"views": {
"type": "number",
"description": "The number of views"
},
"sizeOnDisk": {
"type": "number",
"description": "The data size, in bytes"
},
"empty": {
"type": "boolean",
"description": "True when the database has no collections"
}
},
"required": [
"name",
"collections",
"views",
"sizeOnDisk",
"empty"
],
"additionalProperties": {}
}
}