Skip to main content
PUT

Recipes

1

1. Set an update operator for an array field to add values to the array

Apply an add_to_set operator to an array field to add values to the array. Here, the add_to_set operator is applied to the films field with new values that should be added to the array.
2

2. Set an update operator for another array field to remove values from the array

Apply a pull operator to the array field to remove values from the array. Here, the pull operator is applied to the ratings field with the values that should be removed from its array.
3

3. As a result, the API returns the updated record.

The specified values are added to the films array and removed from the ratings array.
1

1. Set an update operator for an array field to increment values of an array

Apply the inc operator to an array field to increment its values. Here, the inc operator is applied to the score_value and progress fields.
2

2. Set an update operator for another array field to append values to it

Apply a push operator to the array to append values to it. Here, the push operator is applied to the completed_levels field with the values that should be appended.
3

3. As a result, the API returns the updated record.

The 4 value is appended to the completed_levels array while the score_value and progress values are incremented by the 20 and 0.11.
1

1. Set an array element

Set an array element that should be updated.
2

2. As a result, the API returns an updated array.

The 1st element of the movie array is updated to Titanic.
1

1. Set a new value for a field

You can update a value of the field. Here, the game_mode_name field is set to rainbow dash.
2

2. As a result, the API returns an updated record.

1

1. Use 'Authorization' header to pass API key

2

2. Set an update operator for an array field to add values to the array

Apply an add_to_set operator to an array field to add values to the array. Here, the add_to_set operator is applied to the films field with new values that should be added to the array.
3

3. Set an update operator for another array field to remove values from the array

Apply a pull operator to the array field to remove values from the array. Here, the pull operator is applied to the ratings field with the values that should be removed from its array.
4

4. As a result, the API returns the updated record.

The specified values are added to the films array and removed from the ratings array.
1

1. Use 'Authorization' header to pass API key

2

2. Set an update operator for an array field to increment values of an array

Apply the inc operator to an array field to increment its values. Here, the inc operator is applied to the score_value and progress fields.
3

3. Set an update operator for another array field to append values to it

Apply a push operator to the array to append values to it. Here, the push operator is applied to the completed_levels field with the values that should be appended.
4

4. As a result, the API returns the updated record.

The 4 value is appended to the completed_levels array while the score_value and progress values are incremented by the 20 and 0.11.
1

1. Use 'Authorization' header to pass API key

2

2. Set an array element

Set an array element that should be updated.
3

3. As a result, the API returns an updated array.

The 1st element of the movie array is updated to Titanic.
1

1. Use 'Authorization' header to pass API key

2

2. Set a new value for a field

You can update a value of the field. Here, the game_mode_name field is set to rainbow dash.
3

3. As a result, the API returns an updated record.

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 (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: Search operators The request can contain all, some or none of the next search operators: Allowed permissions

Path Parameters

class_name
string
required
Custom object class name.
custom_object_record_id
string
required
ID of the custom object record. Generated automatically by the server after record creation.

Body Parameters

{custom_field_N}
string
Update a value to the field defined in Custom Object class.
{custom_array_field_N}
string
Update the array element by index. Update Operators. Example: cartoons[1]=Aladdin.
inc
object
pull
object
pull_all
object
pop
object
push
object
add_to_set
object
permissions
string
Record permissions. Format:
permission.<CRUD_operation>.access=<value>
permission.<CRUD_operation>.<option>=<value>
CRUD operations: create, read, update, delete.
CRUD access values: open, owner, open_for_users_ids, open_for_groups.
CRUD options: ids, groups.

Headers

QB-Token
string
required
A user or application session token. See Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
Authorization
string
default:"ApiKey {your_api_key}"
API key from Dashboard. Expected format: ApiKey {your_api_key}. Must be used either QB-Token or Authorization.
On-Behalf-Of
string
User ID. The user ID of the user on whose behalf the request is being made.

Responses

A successful response
_id
string
_parent_id
string
created_at
integer
updated_at
integer
user_id
integer
permissions
object