Queries

The Queries routes of the REST API, with an example of each.

Operations

Finds documents, runs aggregations, counts documents and gets distinct values.

POST /v1/databases/{db}/collections/{coll}/find

Equivalent to MongoDB's find command.

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

POST /v1/databases/{db}/collections/{coll}/aggregate

Equivalent to MongoDB's aggregate command.

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

POST /v1/databases/{db}/collections/{coll}/countDocuments

Equivalent to MongoDB's aggregate command.

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

GET /v1/databases/{db}/collections/{coll}/estimatedDocumentCount

Equivalent to MongoDB's count command.

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

POST /v1/databases/{db}/collections/{coll}/distinct

Equivalent to MongoDB's distinct command.

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

See also