amazon-qldb-kvs-nodejs
Version:
A helper module, simplifying basic interactions with Amazon Quantum Ledger Database for Node.js through a simple key-value store interface.
16 lines (15 loc) • 790 B
TypeScript
import { TransactionExecutor } from "amazon-qldb-driver-nodejs";
export declare class UpsertResult {
documentId: string;
txId: string;
}
/**
* Updates or inserts a new document, using keyAttributeName to hold a unique key.
* @param txn The {@linkcode TransactionExecutor} for lambda execute.
* @param tableName The name of a table.
* @param keyAttributeName The name of an attribute for indexing.
* @param documentIon Document to add to the table. Should contain an attribute with the name "keyAttributeName".
* @returns A number of changes made to the ledger.
* @throws Error: If error happen during the process.
*/
export declare function upsert(txn: TransactionExecutor, tableName: string, keyAttributeName: string, documentIon: object, version?: number): Promise<UpsertResult>;