AddConnection

Add a connection between to referenced objects, and properties associated with the new connection.

Parameters

  • class: Name of the class for the connection.
  • ref1: Reference to the object that is the source of the connection.
  • ref2: Reference to the object that is the destination of the connection.

Blocks

Details

The source and destination references (ref1 and ref2) correspond to references created with the another command within the transaction.

The properties are key-value pairs associated with the connection. Check properties for more details.

Examples

Add an Entity of the class “Person” and an image, and create a Connection between the two objects:

[ {
    "AddEntity" : {
        "class" : "Person",
        "_ref": 1,
        "properties" : {
            "name" :  "Jane Polansky",
            "gender": "F",
            "email":  "jane.p@xyz.com"
        }
    }
},{
    "AddEntity" : {
        "class" : "Person",
        "_ref": 2,
        "properties" : {
            "name" :  "Jon Doe",
            "gender": "M",
            "email":  "jon.doe@xyz.com"
        }
    }

}, {
    "AddConnection" : {
        "class" : "BestFriendsForever",
        "ref1" : 1,
        "ref2" : 2,
        "properties" : {
            "place_met" : "Fake Street 123",
            "date" :    {"_date", "Mon Apr 10 10:59:24 PDT 1970"}
        }
    }
} ]