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 parameters | None |
| Body | None |
| Responses | 200, 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 parameters | db |
| Body | None |
| Responses | 200, 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 parameters | db |
| Body | JSON, canonical Extended JSON or BSON |
| Responses | 200, 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 parameters | dbcoll |
| Body | None |
| Responses | 200, default |
Shell
curl -X DELETE https://<node>:27080/v1/databases/{db}/collections/{coll} \
-H "Authorization: Bearer $TESELADB_API_KEY"