Skip to main content

DeleteDescriptor

Deletes descriptor objects that satisfy the specified constraints,

and all the connections to/from those descriptor objects.

Parameters

  • set: Name of the set.
  • [optional] ref: Reference to descriptor objects within the transaction (result of a FindDescriptor).
  • [optional] constraints

Details

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 descriptors with "confidence" property less than 0.8:


[{
"DeleteDescriptor": {
"set": "embeddings",
"constraints": {
"confidence": ["<=", 0.8]
}
}
}]

Successful response:


[{
"DeleteDescriptor": {
"count": 9,
"status": 0
}
}]

Delete descriptors with "confidence" property less than 0.8 and connections to entities of class "Person" with the "age" property equal to 30:


[{
"FindEntity": {
"with_class": "Person",
"_ref": 1,
"constraints": {
"age": ["==", 30]
}
}
}, {
"FindDescriptor": {
"_ref": 2,
"constraints": {
"confidence": ["<=", 0.8]
},
"is_connected_to": {
"ref": 1
}
}
}, {
"DeleteDescriptor": {
"ref": 2
}
}]

Successful response:


[{
"FindEntity": {
"returned": 0,
"status": 0
}
}, {
"FindDescriptor": {
"returned": 0,
"status": 0
}
}, {
"DeleteDescriptor": {
"count": 1,
"status": 0
}
}]