Skip to main content

FindConnection

Find a connection that satisfy the specified constraints.

Parameters

  • [optional] with_class: Name of the class for the connection.
  • [optional] _ref: Reference to be used within the transaction.
  • [optional] unique: Indicates whether a single connection is expected to satisfy the constraints.
  • [optional] src: Reference to the object that is the source of the connection.
  • [optional] dst: Reference to the object that is the destination of the connection.
  • [optional] constraints
  • [optional] results
  • [optional] batch

Examples

Count the number of connections of class "HasVisited":


[{
"FindConnection": {
"with_class": "HasVisited",
"results": {
"count": true
}
}
}]

Count the number of 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": {
"with_class": "HasVisited",
"src": 1,
"results": {
"count": true,
"list": ["date", "care_taker"],
"sort": "date"
}
}
}]