Skip to main content

DeleteConnection

Deletes connection objects that satisfy the specified constraints.

Parameters​

ref and constraints are optional and are intersected when both are present. with_class further narrows the selection. Scope warning: omitting all selectors targets every object in public connection classes. Always supply selectors for a scoped mutation.

Parameter

JSON type

Behavior

constraints

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.

ref

integer, 1 through 100000

Optional. Select using the other supplied selectors; see the selection rule above. Uses an earlier compatible Connection reference in this transaction; forward references, wrong types, and undeclared references are rejected.

with_class

nonempty string, not starting with underscore

Optional. No additional class restriction; without a reference, all public classes are eligible. Restricts the mutation to this connection class, including when ref is supplied.

Details​

If the ref parameter is used, with_class and 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 with the objects delete permission is required.

The response is an object under DeleteConnection with integer status and, on success, integer count. Status 0 means the mutation completed; count is the number of selected connections 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. Only matching connections are deleted; endpoint nodes remain.

Examples​

Delete connections of the class “has_item” with “confidence” property less than 0.8:

[{
"DeleteConnection": {
"with_class": "has_item",
"constraints": ["$confidence", "==", 0.8]
}
}]

Delete the connections of class “HasVisited” that an Entity of the class “Patient” has, where the Entity of class “Patient” is the source of the Connection, and retrieve the “date” and “care_taker” properties of the Connection. Sort the results by date:

[{
"FindEntity": {
"with_class": "Patient",
"_ref": 1,
"constraints": ["$patient_id", "==", 231]
}
}, {
"FindConnection": {
"_ref": 2,
"with_class": "HasVisited",
"src": 1,
"sort": "date",
"results": {
"count": true,
"list": ["date", "care_taker"]
}
}
}, {
"DeleteConnection": {
"ref": 2
}
}]