コード例 #1
0
 /// <summary>
 /// Adds an operation to delete a document's data in this transaction.
 /// </summary>
 /// <param name="documentReference">The document to delete. Must not be null.</param>
 /// <param name="precondition">Optional precondition for deletion. May be null, in which case the deletion is unconditional.</param>
 public void Delete(DocumentReference documentReference, Precondition precondition = null)
 {
     // Preconditions are validated by WriteBatch.
     _writes.Delete(documentReference, precondition);
 }
コード例 #2
0
 /// <summary>
 /// Adds an operation to update a document's data in this transaction.
 /// </summary>
 /// <param name="documentReference">The document to update. Must not be null.</param>
 /// <param name="updates">The updates to perform on the document, keyed by the field path to update. Fields not present in this dictionary are not updated. Must not be null.</param>
 /// <param name="precondition">Optional precondition for updating the document. May be null, which is equivalent to <see cref="Precondition.MustExist"/>.</param>
 public void Update(DocumentReference documentReference, Dictionary <FieldPath, object> updates, Precondition precondition = null)
 {
     // Preconditions are validated by WriteBatch.
     _writes.Update(documentReference, updates, precondition);
 }
コード例 #3
0
 /// <summary>
 /// Adds an operation to create a document in this transaction.
 /// </summary>
 /// <param name="documentReference">The document reference to create. Must not be null.</param>
 /// <param name="documentData">The data for the document. Must not be null.</param>
 public void Create(DocumentReference documentReference, object documentData)
 {
     // Preconditions are validated by WriteBatch.
     _writes.Create(documentReference, documentData);
 }
コード例 #4
0
 /// <summary>
 /// Adds an operation to set a document's data in this transaction.
 /// </summary>
 /// <param name="documentReference">The document in which to set the data. Must not be null.</param>
 /// <param name="documentData">The data for the document. Must not be null.</param>
 /// <param name="options">The options to use when updating the document. May be null, which is equivalent to <see cref="SetOptions.Overwrite"/>.</param>
 public void Set(DocumentReference documentReference, object documentData, SetOptions options = null)
 {
     // Preconditions are validated by WriteBatch.
     _writes.Set(documentReference, documentData, options);
 }
コード例 #5
0
 internal IAsyncEnumerable <CollectionReference> ListCollectionsAsync(DocumentReference parent) =>
 Client.ListCollectionIdsAsync(parent?.Path ?? RootPath)
 .Select(id => new CollectionReference(this, parent, id));