# Queries
Quick Tip
For a quick reference to this endpoint click the "Developer Tools" button on your Objects table view in your Bucket Dashboard (opens new window).
# getObjects
Get Objects from a Bucket.
getObjects(bucket_slug, input)
# Try it
Full screen (opens new window)
# Advanced Queries (Beta)
Advanced queries give you powerful NoSQL database-like functionality for content fetching. Use the query
parameter to send a valid JSON (stringified) query on the Get Objects Method.
# Available Keys to Query
Parameter | Description |
---|---|
_id | Object _id |
title | Object Title |
slug | Object Slug |
content | Object Content |
created_at | Object Created at Date |
published_at | Object Published at Date |
modified_at | Object Modified at Date |
created_by | Object Created by user id |
modified_by | Object Modified by user id |
metadata.$key | Metadata value(s) |
# Query Selectors
Parameter | Description |
---|---|
$eq | Matches values that are equal to a specified value. Equivalent to direct key/value query. |
$gt | Matches values that are greater than a specified value. |
$gte | Matches values that are greater than or equal to a specified value. |
$lt | Matches values that are less than a specified value. |
$lte | Matches values that are less than or equal to a specified value. |
$in | Matches any of the values specified in an array. |
$ne | Matches all values that are not equal to a specified value. |
$nin | Matches none of the values specified in an array. |
$all | Matches arrays that contain all elements specified in the query. |
$regex, $options | Search for string, use $options: "i" for case insensitive matches |
# Logic Operators
Parameter | Description |
---|---|
$and | Returns Objects that match all conditions |
$or | Returns Objects that match any conditions |
# Try it
Some queries will require a separate variable. Add something like this to the Query Variables area:
{
"query": {
"title": {
"$regex": "another",
"$options": "i"
}
}
}
Full screen (opens new window)
# More Examples
See more Advanced Queries examples in the REST API docs.
# getObject
Get a single Object from a Bucket.
getObject(bucket_slug, input)
# Try it
Full screen (opens new window)
# getObjectRevisions
Get Object Revisions from a Bucket.
getObjectRevisions(bucket_slug, object_slug, input)
# Try it
Full screen (opens new window)
# getMedia
Get Media from a Bucket.
getMedia(bucket_slug, input)
# Try it
Full screen (opens new window)
# getObjectTypes
Get Object Types from a Bucket.
getObjectTypes(bucket_slug, input)
# Try it
Full screen (opens new window)
# getBucket
Get all Bucket content.
getBucket(bucket_slug)
# Try it
Full screen (opens new window)
# getAccessToken
Get token for account-related access (not required for Bucket-level access).
getAccessToken(email, password)
# Try it
Full screen (opens new window)
# getBuckets
Get all Buckets on your user account.
getBuckets()
Requires Authorization
in HTTP Header. Find token in Account Settings or using the getAccessToken
method.
# Try it
Full screen (opens new window)
# getUsers
Get Users in a Bucket.
getUsers(bucket_slug)
Requires Authorization
in HTTP Header. Find token in Account Settings or using the getAccessToken
method.
# Try it
Full screen (opens new window)
# getUser
Get a User in a Bucket.
getUser(bucket_slug, user_id)
Requires Authorization
in HTTP Header. Find token in Account Settings or using the getAccessToken
method.