set method

Future<WriteResult> set(
  1. T data
)

Writes to the document referred to by this DocumentReference. If the document does not yet exist, it will be created.

Implementation

Future<WriteResult> set(T data) async {
  final writeBatch = WriteBatch._(this.firestore)..set(this, data);

  final results = await writeBatch.commit();
  return results.single;
}