UpdateImage
Updates existing Image objects that satisfy the specified constraints.
Parameters
- [optional] ref: Reference to other entities within the transaction.
- [optional] constraints
- [optional] properties
- [optional] remove_props
Details
If the ref parameter is used, constraints will be ignored.
If the ref parameter is specified, it must refer to the search result of a previous FindImage.
For more complex searches for object to delete, a Find command must be used first within the transaction.
Examples
Find the images with the "year_captured" property equal to 2007, and remove the "focal_length" property:
[{
"UpdateImage": {
"constraints": {
"year_captured": ["==", 1990]
},
"remove_props": ["focal_length"]
}
}]
Successful response:
[{
"UpdateImage": {
"count": 1,
"status": 0
}
}]
Find an image with the "year_captured" property equal to 2007, verify that only one image satisfy the constraint, update the "focal_length_mm" property:
[{
"UpdateImage": {
"constraints": {
"year_captured": ["==", 1992]
},
"properties": {
"focal_length_mm": 55
}
}
}]
Successful response:
[{
"UpdateImage": {
"count": 1,
"status": 0
}
}]
Remove "focal_lenght" property from all the images that are connected to an entity of the class "Dataset" and with a property "name" equal to "COCO":
[{
"FindEntity": {
"with_class": "Dataset",
"_ref": 1,
"constraints": {
"name": ["==", "COCO"]
}
}
}, {
"FindImage": {
"_ref": 2,
"is_connected_to": {
"ref": 1,
"connection_class": "in_dataset"
},
"blobs": false
}
}, {
"UpdateImage": {
"ref": 2,
"remove_props": ["focal_length"]
}
}]
Successful response:
[{
"FindEntity": {
"status": 0,
"returned": 0
}
}, {
"FindImage": {
"status": 0,
"returned": 0
}
}, {
"UpdateImage": {
"count": 1,
"status": 0
}
}]