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","collections","create"], { name: "<name>" });
console.log(JSON.stringify(result));From the command line
$ mark mongo collections create --name <string>
As data, in a program
{
"$proc": ["mongo", "collections", "create"],
"input": { "name": "<name>" }
}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
},
"name": {
"type": "string",
"minLength": 1,
"description": "The name of the new collection"
},
"options": {
"description": "The options of the collection",
"type": "object",
"properties": {
"capped": {
"description": "Make a capped collection",
"type": "boolean"
},
"size": {
"description": "The maximum size in bytes (capped collections)",
"type": "number"
},
"max": {
"description": "The maximum number of documents (capped collections)",
"type": "number"
},
"validator": {
"description": "A validator document (for example a $jsonSchema)",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"additionalProperties": {}
}
},
"required": [
"name"
]
},
"output": {
"type": "object",
"properties": {
"acknowledged": {
"type": "boolean",
"description": "True when the server confirmed the write"
},
"collectionName": {
"type": "string",
"description": "The name of the new collection"
}
},
"required": [
"acknowledged",
"collectionName"
],
"additionalProperties": {}
}
}