Learn how to store and sync data with QuickBlox key-value storage.
_id
, user_id
, parent_id
, created_at
, and updated_at
.
Allowed data types: Integer (or Array of Integer); String (or Array of String); Float (or Array of Float); Boolean (or Array of Boolean); Location (Array of [< longitude >, < latitude >]); File; Date.
Visit Key Concepts page to learn the most important QuickBlox concepts.
create()
method. To create a single record, use the code snippet below.
Argument | Required | Description |
---|---|---|
className | yes | A name of a custom object class. |
data | yes | Data records that will be created. |
function() | yes | Specifies a callback function that accepts an error and result. |
list()
method.
Argument | Required | Descriptions |
---|---|---|
className | yes | A name of a custom object class. |
ids | yes | Records IDs. |
function() | yes | Specifies a callback function that accepts an error and result. |
Note
class with specific IDs in the array.
Argument | Required | Description |
---|---|---|
className | yes | A name of a custom object class. |
filter | yes | Specifies filtering criteria for the field. |
function() | yes | Specifies a callback function that accepts an error and result. |
filter
:
Field | Required | Description |
---|---|---|
skip | no | Skip N records in search results. Useful for pagination. Default (if not specified): 0. Should be an Integer. |
limit | no | Limit search results to N records. Useful for pagination. Default value: 100. |
GameOfThrones
by the age
field with a value greater than 20
, limited to 2 records on the page.
Search operators | Applicable to types | Description |
---|---|---|
lt | integer, float | Less Than operator. |
lte | integer, float | Less Than or Equal to operator. |
gt | integer, float | Greater Than operator. |
gte | integer, float | Greater Than or Equal to operator. |
ne | integer, float, string, boolean | Not Equal to operator. |
in | integer, float, string | IN array operator. |
nin | integer, float, string | Not IN array operator. |
all | array | ALL are contained in array. |
or | integer, float, string | All records that contain a value 1 or value 2. |
ctn | string | All records that contain a particular substring. |
GameOfThrones
class sorted in descending order by the created_at
field.
Sort options | Applicable to types | Description |
---|---|---|
sort_asc | All types | Search results will be sorted in ascending order by the specified field. |
sort_desc | All types | Search results will be sorted in descending order by the specified field. |
GameOfThrones
class.
Aggregation operator | Description |
---|---|
count | Count search results. The response will contain only a count of records found. Set count to 1 to apply. |
update()
method. You should know the record ID in this case.
delete()
method. To delete a single record, use the code snippet below.
Argument | Required | Description |
---|---|---|
className | yes | A name of a custom object class. |
id | yes | ID of the record. |
function() | yes | Specifies a callback function that accepts an error and result. |
Argument | Required | Description |
---|---|---|
className | yes | A name of a custom object class. |
ids | yes | Records IDs. |
function() | yes | Specifies a callback function that accepts an error and result. |
Argument | Required | Description |
---|---|---|
className | yes | A name of a custom object class. |
criteria | yes | Specifies criteria fields that should be set. |
function() | yes | Specifies a callback function that accepts an error and result. |
_parent_id
field.
For example, we have the class Rating that contains score
, review
, and comment
fields. We also have a Movie class. So we can create a record of class Rating that will point to the record of the class Movie via its _parent_id
field, so the _parent_id
field will contain the ID of record from class Movie.
_parent_id
field set to the Movie class record ID) will be automatically deleted as well._parent_id=<id_of_parent_class_record>
.Argument | Required | Description |
---|---|---|
className | yes | A name of a custom object class. |
payload | yes | Specifies payload fileds that should be set. |
function() | yes | Specifies a callback function that accepts an error and result. |
File
field type. It is created to work easily with content from the Custom Objects module. There is an ability to upload, download, update and delete the content of file fields.