Inserts one or more records into a table. This is a convenience wrapper that runs `INSERT INTO
;`.
Method Syntax
client.insert(table, data_json, session, txn)Arguments
Argument | Description |
|---|---|
table | The table to insert into. |
data_json | A single record or an array of records, as a JSON string. |
session | An optional session id. |
txn | An optional transaction id. |
Example usage
var resp = client.insert("person", '[{ "name": "Alice" }, { "name": "Bob" }]')Translated query
INSERT INTO $table $data_json;