create method

BatchOperation create({
  1. required String collection,
  2. required Map<String, Object?> fields,
  3. String? recordId,
})

A create; recordId is a client-made id in the grammar of isClientRecordId (04 ยง2.2), and FFX mints one when it is absent. A recordId that already exists fails the batch with recordExists.

Implementation

BatchOperation create({
  required String collection,
  required Map<String, Object?> fields,
  String? recordId,
}) {
  return BatchCreateOperation(
    model: collection,
    recordId: recordId,
    fields: fields,
  );
}