Inserts one or more relation records into a table. This is a convenience wrapper that runs `INSERT RELATION INTO
;`.
Method Syntax
client.insert_relation(table, data_json, session, txn)Arguments
Argument | Description |
|---|---|
table | The relation table to insert into. |
data_json | A single relation or an array of relations, as a JSON string. Each carries an inand an outrecord. |
session | An optional session id. |
txn | An optional transaction id. |
Example usage
var resp = client.insert_relation(
"likes",
'[{ "in": "person:alice", "out": "person:bob" }]',
)Translated query
INSERT RELATION INTO $table $data_json;