To update the existing record you should know the record ID and use a PUT request with application/json
or application/x-www-form-urlencoded
content type of PUT/POST body. Received values will be casted according to the class defined in QuickBlox Dashboard.
A field that is present in class but not specified in the PUT request has a null
value. To nullify the existing value you should specify null
for application/x-www-/form-urlencoded
, and null
for application/json
content type.
An update request updates specified fields only (i.e. other fields will be left untouched). For numeric fields Integer
and Float
, there is a special increment operator inc
that increments or decrements the numeric field.
Update operators
The request can contain next update operators:
Operator | Description |
---|---|
inc | Types: integer, float Example: Increment field |
pull | Types: arrays Example: Removes a specified value from the array field. |
pull with filter | Types: arrays Example: Removes all elements filtered by filter operator from the array. |
pull_all | Types: arrays Example: Removes all specified values from the array. |
pop | Types: arrays Example: Removes the last element from the array. To remove the first, the element value should be equal to 1. |
push | Types: arrays Example: Appends specified values to the array. |
add_to_set | Types: arrays Example: Adds a value to the array only if the value is not in the array already. |
Update array element by index operator | Type: arrays Example: Update the array element by index. |
Search operators
The request can contain all, some or none of the next search operators:
Operator | Description |
---|---|
lt | Less Than operator Types:integer, float Example: |
lte | Less Than or Equal to operator Types: integer, float Example: |
gt | Greater Than operator Types: integer, float Example: |
gte | Greater Than or Equal to operator Types: integer, float Example: |
ne | Not Equal to operator Types: integer, float, string, boolean Example: |
in | Contained IN array operator Types: integer, float, string Example: |
nin | Not contained IN array operator Types: integer, float, string Example: |
all | ALL contained IN array operator Types: array Example: |
or | OR operator Types: integer, float, string Example: Will return records with name Will return records with name |
ctn | Contains substring operator Types: string Example: Will return all records where |
near | Types: location Example: Search records in a specific radius with the current position in meters. Format: |