Skip to main content

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

  • [optional] ref: Reference to polygon objects within the transaction (result of a FindPolygon).
  • [optional] constraints

Details

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

If the ref parameter is used, the search results represented by the ref will not be valid for the remaining commands within the transaction.

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

Warning: Delete is an performance expensive command, as ApertureDB was designed for read intensive workloads.

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, // Do not retrieve pixel data
"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
}
}]