diff --git a/src/pages/docs_sdk_transaction.html b/src/pages/docs_sdk_transaction.html index 147c6aa..50dd145 100644 --- a/src/pages/docs_sdk_transaction.html +++ b/src/pages/docs_sdk_transaction.html @@ -1,12 +1,22 @@

SDK : Transaction

-
-    userbase.transaction(databaseName, operations)
-  .then(() => {
+  

Transaction lets you submit multiple database operations as a single atomic batch. Either all operations succeed, or the entire batch fails. You will never see partial updates. This API will return a promise that gets resolved once the transaction has been fully applied and durably persisted in the database.

- }) - .catch((e) => console.error(e))
+
+    
+    const operations = [
+      { command: 'Update', item: { todo: 'Item A' }, id: '0001' },
+      { command: 'Insert', item: { todo: 'Item B' }, id: '0002' },
+      { command: 'Delete', item: { todo: 'Item C' }, id: '0003' }
+    ]
+
+    userbase.transaction(databaseName, operations)
+      .then(() => {
+        // transaction applied
+      })
+    .catch((e) => console.error(e))
+    
   

Parameters

@@ -16,7 +26,7 @@ databaseName [string | Len: 1-50] - The database name to use.
  • - operations [Array] - The Insert, Update, or Delete operations to execute in an atomic transaction. + operations [Array] - The Insert, Update, or Delete operations to execute as an atomic transaction.