docbase

v0.1.0
io.github.CloudCorpRecords/docbase Checked 2 days ago Published 1 month ago

MongoDB tools: query, aggregate, index, and administer collections and databases.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

connect

Connect to a MongoDB instance

ParameterTypeDescription
connectionStringstringMongoDB connection string (mongodb:// or mongodb+srv://) to connect with; overrides the configured connection for this call.

list-databases

List all databases in the connected MongoDB instance

list-collections

List collections in a MongoDB database

ParameterTypeDescription
database *stringName of the MongoDB database whose collections to list.

collection-schema

Describe the schema for a collection

ParameterTypeDescription
collection *stringName of the collection whose schema to describe.
database *stringName of the MongoDB database containing the collection.

collection-indexes

List indexes for a collection

ParameterTypeDescription
collection *stringName of the collection whose indexes to list.
database *stringName of the MongoDB database containing the collection.

collection-storage-size

Get the storage size of a collection

ParameterTypeDescription
collection *stringName of the collection whose storage size to report.
database *stringName of the MongoDB database containing the collection.

find

Run a find query against a MongoDB collection

ParameterTypeDescription
collection *stringName of the collection to query.
database *stringName of the MongoDB database containing the collection.
filterobjectMongoDB query filter document matching the documents to return.
limitnumberMaximum number of documents to return; must be positive.
projectionobjectProjection document controlling which fields are returned in each document.
sortobjectSort document mapping each field to its sort direction (1 for ascending, -1 for descending).

aggregate

Run an aggregation pipeline against a MongoDB collection

ParameterTypeDescription
collection *stringName of the collection to run the aggregation pipeline against.
database *stringName of the MongoDB database containing the collection.
pipeline *arrayAggregation pipeline stages, each an object such as a $match or $group stage, applied in order.

count

Count documents in a MongoDB collection

ParameterTypeDescription
collection *stringName of the collection whose documents to count.
database *stringName of the MongoDB database containing the collection.
queryobjectQuery filter document selecting the documents to count.

insert-many

Insert documents into a MongoDB collection

ParameterTypeDescription
collection *stringName of the collection to insert the documents into.
database *stringName of the MongoDB database containing the collection.
documents *arrayDocuments to insert; a non-empty array of objects.

update-many

Update documents in a MongoDB collection

ParameterTypeDescription
collection *stringName of the collection whose documents to update.
database *stringName of the MongoDB database containing the collection.
filter *objectFilter document selecting the documents to update.
update *objectUpdate document to apply to the matching documents, for example using update operators such as $set.

delete-many

Delete documents from a MongoDB collection

ParameterTypeDescription
collection *stringName of the collection whose documents to delete.
database *stringName of the MongoDB database containing the collection.
filter *objectFilter document selecting the documents to delete; all matching documents are deleted.

create-collection

Create a new collection in a MongoDB database

ParameterTypeDescription
collection *stringName of the new collection to create.
database *stringName of the MongoDB database in which to create the collection.

drop-collection

Drop a collection from a MongoDB database

ParameterTypeDescription
collection *stringName of the collection to drop.
database *stringName of the MongoDB database containing the collection.

drop-database

Drop a MongoDB database

ParameterTypeDescription
database *stringName of the MongoDB database to drop.

rename-collection

Rename a MongoDB collection

ParameterTypeDescription
collection *stringCurrent name of the collection to rename.
database *stringName of the MongoDB database containing the collection.
newName *stringNew name for the collection, within the same database.

create-index

Create an index on a MongoDB collection

ParameterTypeDescription
collection *stringName of the collection to create the index on.
database *stringName of the MongoDB database containing the collection.
keys *objectIndex keys document mapping each field to its index direction or type (for example 1, -1, or "text"); must name at least one field.

drop-index

Drop an index from a MongoDB collection

ParameterTypeDescription
collection *stringName of the collection to drop the index from.
database *stringName of the MongoDB database containing the collection.
indexName *stringName of the index to drop from the collection.

explain

Get the execution plan for a MongoDB query

ParameterTypeDescription
collection *stringName of the collection the explained operation runs against.
database *stringName of the MongoDB database containing the collection.
methodarrayArray naming the operation method to explain; the first entry is used and find is used when this is omitted.
methodArgsobjectArguments document for the explained method, merged into the operation being explained.

export

Export a MongoDB collection to a file

ParameterTypeDescription
collection *stringName of the collection to export.
database *stringName of the MongoDB database containing the collection.
exportTitlestringTitle for the export; the collection name is used when this is omitted.
filterobjectFilter document selecting the documents to export.

db-stats

Get statistics for a MongoDB database

ParameterTypeDescription
database *stringName of the MongoDB database whose statistics to return.

mongodb-logs

Retrieve MongoDB log entries

ParameterTypeDescription
limitnumberMaximum number of log lines to return; must be positive.
typestringLog type or component to retrieve; global is used when this is omitted.