DeletePolygon
Deletes existing polygon objects resulting from a prior command or satisfying the specified constraints. All connections to/from deleted polygon objects will be removed also.
Parameters
ref and constraints are optional and are intersected when both are present. Scope warning: omitting all selectors targets every Polygon object. Always supply selectors for a scoped mutation.
Parameter | JSON type | Behavior |
|---|---|---|
array expression | Optional. No property filter; the command-specific selector requirement still applies. Filters existing objects using the constraints expression language. When ref is supplied it filters that referenced set. | |
integer, 1 through 100000 | Optional. Select using the other supplied selectors; see the selection rule above. Uses an earlier compatible Polygon reference in this transaction; forward references, wrong types, and undeclared references are rejected. |
Details
If the ref parameter is used, constraints will act as additional filters on the referenced result set.
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 is required. This command currently has no objects.delete permission requirement. This is a known permission-mapping limitation; do not use that permission as an access boundary for this command.
The response is an object under DeletePolygon 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 polygons with “id” property equal to 22:
[{
"DeletePolygon": {
"constraints": ["$id", "==", 22]
}
}]
Successful response:
[{
"DeletePolygon": {
"count": 1,
"status": 0
}
}]
Delete all polygons associated with the image with “id” equal to 30:
[{
"FindImage": {
"_ref": 1,
"blobs": false,
"constraints": ["$id", "==", 30]
}
}, {
"FindPolygon": {
"_ref": 2,
"image_ref": 1
}
}, {
"DeletePolygon": {
"ref": 2
}
}]
Successful response:
[{
"FindImage": {
"returned": 0,
"status": 0
}
}, {
"FindPolygon": {
"returned": 0,
"status": 0
}
}, {
"DeletePolygon": {
"count": 1,
"status": 0
}
}]