Databases and collections

The Databases and collections routes of the REST API, with an example of each.

Operations

Lists databases and collections, creates a collection or drops it.

GET /v1/databases

Equivalent to MongoDB's listDatabases command.

Path parametersNone
BodyNone
Responses200, default
Shell
curl https://<node>:27080/v1/databases \
  -H "Authorization: Bearer $TESELADB_API_KEY"

GET /v1/databases/{db}/collections

Equivalent to MongoDB's listCollections command.

Path parametersdb
BodyNone
Responses200, default
Shell
curl https://<node>:27080/v1/databases/{db}/collections \
  -H "Authorization: Bearer $TESELADB_API_KEY"

POST /v1/databases/{db}/collections

Equivalent to MongoDB's create command.

Path parametersdb
BodyJSON, canonical Extended JSON or BSON
Responses200, default
Shell
curl -X POST https://<node>:27080/v1/databases/{db}/collections \
  -H "Authorization: Bearer $TESELADB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

DELETE /v1/databases/{db}/collections/{coll}

Equivalent to MongoDB's drop command.

Path parametersdbcoll
BodyNone
Responses200, default
Shell
curl -X DELETE https://<node>:27080/v1/databases/{db}/collections/{coll} \
  -H "Authorization: Bearer $TESELADB_API_KEY"

See also