Skip to main content

UpdateFrame

Updates existing Frame objects that satisfy the specified constraints.

Parameters

Details

If the ref parameter is used, constraints will be ignored.

If the ref parameter is specified, it must refers to the search results of a previous FindFrame.

For more complex searches for objects to delete, a Find command must be used first within the transaction.

Examples

Find the frames with the "year_captured" property equal to 2007, remove the "focal_length" property:


[{
"UpdateFrame": {
"constraints": {
"year_captured": ["==", 2007]
},
"remove_props": ["focal_length"]
}
}]

Successful response:


[{
"UpdateFrame": {
"count": 1,
"status": 0
}
}]

Find a video with the "year_captured" property equal to 2007, verify that only one video satisfy the constraint, and add a "source" property to all its associated frames with the value "my_new_model":


[{
"FindVideo": {
"_ref": 1,
"unique": true,
"constraints": {
"year_captured": ["==", 2007]
}
}
}, {
"FindFrame": {
"video_ref": 1,
"_ref": 2
}
}, {
"UpdateFrame": {
"ref": 2,
"properties": {
"source": "my_new_model"
}
}
}]

Successful response:


[{
"FindVideo": {
"returned": 0,
"status": 0
}
}, {
"FindFrame": {
"returned": 0,
"status": 0
}
}, {
"UpdateFrame": {
"count": 1,
"status": 0
}
}]

Find the frame with frame_number equals to 32 for the video with the "year_captured" property equal to 2007, and remove the "source" property.


[{
"FindVideo": {
"_ref": 1,
"unique": true,
"constraints": {
"year_captured": ["==", 1995]
}
}
}, {
"FindFrame": {
"video_ref": 1,
"_ref": 2,
"in_frame_number_range": {
"start": 31,
"stop": 33
}
}
}, {
"UpdateFrame": {
"ref": 2,
"remove_props": ["source"]
}
}]

Successful response:


[{
"FindVideo": {
"returned": 0,
"status": 0
}
}, {
"FindFrame": {
"returned": 0,
"status": 0
}
}, {
"UpdateFrame": {
"count": 1,
"status": 0
}
}]