@@ -28,9 +28,17 @@ declare namespace FirebaseFirestore {
2828 export type DocumentData = { [ field : string ] : any } ;
2929
3030 /**
31- * Update data (for use with `DocumentReference.update()`) consists of field
32- * paths (e.g. 'foo' or 'foo.baz') mapped to values. Fields that contain dots
33- * reference nested fields within the document.
31+ * Update data (for use with [update]{@link DocumentReference#update})
32+ * that contains paths mapped to values. Fields that contain dots reference
33+ * nested fields within the document.
34+ *
35+ * You can update a top-level field in your document by using the field name
36+ * as a key (e.g. `foo`). The provided value completely replaces the contents
37+ * for this field.
38+ *
39+ * You can also update a nested field directly by using its field path as a
40+ * key (e.g. `foo.bar`). This nested field update replaces the contents at
41+ * `bar` but does not modify other data under `foo`.
3442 */
3543 export type UpdateData = { [ fieldPath : string ] : any } ;
3644
@@ -300,8 +308,22 @@ declare namespace FirebaseFirestore {
300308 * the transaction.
301309 *
302310 * You can use the transaction object passed to 'updateFunction' to read and
303- * modify Firestore documents under lock. Transactions are committed once
304- * 'updateFunction' resolves and attempted up to five times on failure.
311+ * modify Firestore documents under lock. You have to perform all reads
312+ * before before you perform any write.
313+ *
314+ * Documents read during a transaction are locked pessimistically. A
315+ * transaction's lock on a document blocks other transactions, batched
316+ * writes, and other non-transactional writes from changing that document.
317+ * A transaction releases its document locks at commit time or once it times
318+ * out or fails for any reason.
319+ *
320+ * Transactions are committed once 'updateFunction' resolves. If a
321+ * transaction fails with contention, the transaction is retried up to five
322+ * times. The `updateFunction` is invoked once for each attempt.
323+ *
324+ * Transactions time out after 60 seconds if no documents are read.
325+ * Transactions that are not committed within than 270 seconds are also
326+ * aborted.
305327 *
306328 * @param updateFunction The function to execute within the transaction
307329 * context.
0 commit comments