curl --request PUT \
--url https://{instance}.domo.com/api/datastores/v2/collections/{collectionId}/documents/update \
--header 'Content-Type: application/json' \
--header 'X-DOMO-Developer-Token: <api-key>' \
--data '
{
"query": {
"content.status": "Draft"
},
"operation": {
"$set": {
"content.status": "Active"
}
}
}
'1{
"message": "query is required",
"status": 400,
"statusReason": "Bad Request",
"toe": "8PJRQYWMHF-NXB3Z-KTZUA"
}{
"message": "Cannot find permission from source [USER:870010733] to target [MAGNUM_COLLECTION:a3f7d891-bc24-4e56-9a12-c7e3b0f845d2]. Permission Service reports that one or both does not exist",
"status": 404,
"statusReason": "Not Found",
"toe": "RG3808D5LS-DHKE4-TG5EB"
}Partially Update Documents
Perform partial updates on documents using MongoDB query and update operations.
Returns the number of documents updated. Returns 0 if no documents matched — this is a successful response, not an error.
$setOnInsert has no effect because AppDB partial updates do not perform upserts.
Supported update operators: currentDate, inc, min, max, mul, rename, set, unset, addToSet, pop, pull, pullAll, push
Supported modifiers: each, position, slice, sort
See the MongoDB Update Operators documentation for details.
PUT
/
api
/
datastores
/
v2
/
collections
/
{collectionId}
/
documents
/
update
curl --request PUT \
--url https://{instance}.domo.com/api/datastores/v2/collections/{collectionId}/documents/update \
--header 'Content-Type: application/json' \
--header 'X-DOMO-Developer-Token: <api-key>' \
--data '
{
"query": {
"content.status": "Draft"
},
"operation": {
"$set": {
"content.status": "Active"
}
}
}
'1{
"message": "query is required",
"status": 400,
"statusReason": "Bad Request",
"toe": "8PJRQYWMHF-NXB3Z-KTZUA"
}{
"message": "Cannot find permission from source [USER:870010733] to target [MAGNUM_COLLECTION:a3f7d891-bc24-4e56-9a12-c7e3b0f845d2]. Permission Service reports that one or both does not exist",
"status": 404,
"statusReason": "Not Found",
"toe": "RG3808D5LS-DHKE4-TG5EB"
}Authorizations
Domo Developer Token for authentication.
Path Parameters
The ID of the collection.
Body
application/json
Response
Returns the number of updated documents or properties.
The response is of type integer.
Example:
1