← All procedures

mongo.database.ping

Health check and connectivity test

MCPCLI
Package
@procedures/mongo · README
Path
["mongo","database","ping"]
CLI
mark mongo database ping
MCP tool
mongo.database.ping on the dev-tools server
As data
{"$proc":["mongo","database","ping"],"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","ping"], {});
console.log(JSON.stringify(result));

From the command line

$ mark mongo database ping

As data, in a program

{ "$proc": ["mongo", "database", "ping"], "input": {} }

Input

FieldTypeRequiredDefaultDescription
collectionstringnoThe collection name. It takes the place of metadata.collection.
databasestringnoThe database name (default: the database of the connection)

Output

FieldTypeRequiredDefaultDescription
okbooleanyesTrue when the server answered
latencyMsnumberyesThe time of the ping, in milliseconds
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": {
      "ok": {
        "type": "boolean",
        "description": "True when the server answered"
      },
      "latencyMs": {
        "type": "number",
        "description": "The time of the ping, in milliseconds"
      }
    },
    "required": [
      "ok",
      "latencyMs"
    ],
    "additionalProperties": {}
  }
}