Creates a record if it does not exist, or updates it if it does. This is a convenience wrapper that runs `UPSERT CONTENT ;`.
Method Syntax
client.upsert(thing, content_json, session, txn)Arguments
Argument | Description |
|---|---|
thing | The table or specific record to upsert. |
content_json | The record content as a JSON string. |
session | An optional session id. |
txn | An optional transaction id. |
Example usage
var resp = client.upsert("person:chiru", '{ "name": "Chiru", "age": 31 }')Translated query
UPSERT $thing CONTENT $content_json;