Updating items

This method will update a single item or multiple items in a set.

Update fields for an existing item in a set

At least 1 parameter is requied in the URL of this request otherwise no items will be updated.

PATCH
/{bucket name}/sets/{set name}/items?{key}={value}
REQUEST BODY
{
  "first_name": "New first name"
}
RESPONSE BODY
[
  {
    "message": "Updated 1 item out of 500 scanned items."
  }
]

Update multiple fields for an existing item in a set

You can update multiple fields for an item in a single request. You can also use this method to add new fields to a set.

PATCH
/{bucket name}/sets/{set name}/items?{key}={value}
REQUEST BODY
{
  "first_name": "New first name",
  "some_new_field": "Something here"
}
RESPONSE BODY
[
  {
    "message": "Updated 1 item out of 500 scanned items."
  }
]

Update items based that match a query

You can tell NotoDB to update items based on query parameters. Example:

PATCH
/mybucket/sets/users/items?last_name=Omand&city=Oakland
REQUEST BODY
{
  "attended_event": true
}
RESPONSE BODY
[
  {
    "message": "Updated 10 items out of 500 scanned items."
  }
]

Remove fields from an item

Remove fields from an item by setting the values to empty. Example:

PATCH
/{bucket name}/sets/{set name}/items?{key}={value}
REQUEST BODY
{
  "first_name": ""
}
RESPONSE BODY
[
  {
    "message": "Updated 1 item out of 500 scanned items."
  }
]

Next articleDeleting items