updateTransactionFrom method

TransactionRequestPayload updateTransactionFrom(
  1. List<int> id,
  2. String collection,
  3. FieldMask mask
)

Implementation

TransactionRequestPayload updateTransactionFrom(
  List<int> id,
  String collection,
  FieldMask mask,
) {
  final primaryKey = Value()..bytesValue = id;
  final updateOp = Operation_UpdateDocument()
    ..collection = collection
    ..document = writeToBuffer()
    ..primaryKey = primaryKey
    ..fieldMask = mask;

  final operation = Operation()..updateDocument = updateOp;
  final documentOperations = DocumentOperations();
  documentOperations.operations
    ..clear()
    ..add(operation);

  final data = TransactionData()..documentOperations = documentOperations;
  return TransactionRequestPayload()..data = data;
}