Skip to content

Commit 0d300b3

Browse files
authored
docs: add doc for runTransactionAsync on the r/w txn sample (#2393)
1 parent 1725cca commit 0d300b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

samples/transaction.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ function readWriteTransaction(instanceId, databaseId, projectId) {
111111

112112
const transferAmount = 200000;
113113

114+
// Note: the `runTransaction()` method is non blocking and returns "void".
115+
// For sequential execution of the transaction use `runTransactionAsync()` method which returns a promise.
116+
// For example: await database.runTransactionAsync(async (err, transaction) => { ... })
114117
database.runTransaction(async (err, transaction) => {
115118
if (err) {
116119
console.error(err);

0 commit comments

Comments
 (0)