This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a list of items based on the provided filtering, sorting, and paging preferences.
See API Query Language for more information about handling data queries.
ID of the collection to query.
Query preferences. See API Query Language for information about handling data queries.
Fields for which to include the full referenced items in the query's results, rather than just their IDs. Returned items are sorted in ascending order by the creation date of the reference. If the field being querried is a multi-reference field and the array is empty, the response does not return any items.
Whether to retrieve data from the primary database instance. This decreases performance but ensures data retrieved is up-to-date even immediately after an update. Applicable if the external database is eventually consistent.
When true
, the query response must include the total number of items that match the query.
Retrieved items.
Pagination information.
curl POST https://external-db.example.com/v3/items/query \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'Authorization: <AUTH>' \
--d '{
"collectionId": "cities",
"query": {
"filter": {
},
"sort": [],
"paging": {
"limit": 50,
"offset": 0
},
"fields": []
},
"includeReferencedItems": [],
"consistentRead": false,
"returnTotalCount": true
}'
{
"items": [
{
"name": "New York",
"_id": "c285e77c-a86b-4361-a55f-c6b934d70187",
"population": 8300000.0,
"country": "US",
"isCapital": false
}
],
"pagingMetadata": {
"total": 1
}
}