POST /1/indexes/{indexName}/{objectID}/partial
Adds new attributes to a record, or updates existing ones.
- If a record with the specified object ID doesn't exist,
a new record is added to the index if
createIfNotExists
is true. - If the index doesn't exist yet, this method creates a new index.
- You can use any first-level attribute but not nested attributes. If you specify a nested attribute, this operation replaces its first-level ancestor.
To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don't have access to your initial data.
- Increment: increment a numeric attribute
- Decrement: decrement a numeric attribute
- Add: append a number or string element to an array attribute
- Remove: remove all matching number or string elements from an array attribute made of numbers or strings
- AddUnique: add a number or string element to an array attribute made of numbers or strings only if it's not already present
- IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn't exist, the engine only creates it if you pass an IncrementFrom value of 0.
- IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn't exist yet, the engine only creates it if you pass an IncrementSet value greater than 0.
You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties:
- _operation: the operation to apply on the attribute
- value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.
This operation is subject to indexing rate limits.
Servers
- https://{appId}.algolia.net
- https://{appId}-1.algolianet.com
- https://{appId}-2.algolianet.com
- https://{appId}-3.algolianet.com
- https://{appId}-dsn.algolia.net
Path parameters
Name | Type | Required | Description |
---|---|---|---|
indexName |
String | Yes |
Name of the index on which to perform the operation. |
objectID |
String | Yes |
Unique record identifier. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Query parameters
Name | Type | Required | Description |
---|---|---|---|
createIfNotExists |
Boolean | No |
Whether to create a new record if it doesn't exist. Default value: true |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.