create method

JSPromise<WriteResult> create(
  1. DocumentReference documentRef,
  2. JSObject data
)

Create a document with the provided data. This single operation will fail if a document exists at its location.

@param documentRef A reference to the document to be created. @param data The object to serialize as the document. @throws Error If the provided input is not a valid Firestore document. @returns A promise that resolves with the result of the write. If the write fails, the promise is rejected with a BulkWriterError{@link BulkWriterError}.

Implementation

external JSPromise<WriteResult> create(
  DocumentReference documentRef,
  JSObject data,
);