DeleteFrame
Deletes Frame objects that satisfy the specified constraints, and all the connections to/from those frame objects.
Parameters
Exactly one of ref or constraints is required. Supplying both is rejected. Use a preceding FindFrame to combine property and relationship filters, then pass its reference.
Parameter | JSON type | Behavior |
|---|---|---|
array expression | Optional. No property filter; the command-specific selector requirement still applies. Selects existing frames by expression. Cannot be combined with ref. | |
integer, 1 through 100000 | Optional. Select using the other supplied selectors; see the selection rule above. Uses an earlier compatible Frame reference in this transaction; forward references, wrong types, and undeclared references are rejected. |
Details
The ref and constraints parameters are mutually exclusive. To combine filters, use FindFrame first and update or delete through its reference.
Deleting objects selected by ref invalidates that reference for the remaining commands in the transaction.
A preceding Find command can select objects using more complex criteria and pass its result to the delete command through ref.
Deletion is computationally expensive; ApertureDB is optimized for workloads that perform more reads than deletes.
Response and errors
An authenticated session with the objects delete permission is required.
The response is an object under DeleteFrame with integer status and, on success, integer count. Status 0 means the mutation completed; count is the number of selected objects affected, including zero when none match. No output blobs are returned.
Invalid field types, missing required fields, malformed expressions, and invalid references fail validation. Execution failures include a nonzero status and an info message; inspect the transaction response before assuming a mutation succeeded. Deleting nodes also removes incident connections.
Examples
Delete Frame objects with “my_id” property equal to 22:
[{
"DeleteFrame": {
"constraints": ["$my_id", "==", 22]
}
}]
Successful response:
[{
"DeleteFrame": {
"count": 1,
"status": 0
}
}]
Delete Frame objects with “source” property equal to “my_model”, and with frame number greater than 10, and that have connections to a Video with the “year_captured” property equal to 1990:
[{
"FindVideo": {
"_ref": 1,
"constraints": ["$year_captured", "==", 1990]
}
}, {
"FindFrame": {
"_ref": 2,
"in_frame_number_range": {
"start": 10
},
"constraints": ["$source", "==", "my_model"],
"is_connected_to": {
"ref": 1
}
}
}, {
"DeleteFrame": {
"ref": 2
}
}]
Successful response:
[{
"FindVideo": {
"returned": 0,
"status": 0
}
}, {
"FindFrame": {
"returned": 0,
"status": 0
}
}, {
"DeleteFrame": {
"count": 1,
"status": 0
}
}]