createTransactionFrom method

TransactionRequestPayload createTransactionFrom(
  1. String collection
)

Implementation

TransactionRequestPayload createTransactionFrom(String collection) {
  final insertOp = Operation_InsertDocument()
    ..collection = collection
    ..document = writeToBuffer();
  final operation = Operation()..insertDocument = insertOp;

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

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