create method

WriteBatch create(
  1. DocumentReference documentRef,
  2. JSObject data
)

Create the document referred to by the provided DocumentReference. The operation will fail the batch if a document exists at the specified location.

@param documentRef A reference to the document to be created. @param data The object data to serialize as the document. @throws Error If the provided input is not a valid Firestore document. @return This WriteBatch instance. Used for chaining method calls.

Implementation

external WriteBatch create(DocumentReference documentRef, JSObject data);