set method

void set(
  1. String id,
  2. Data data
)

Method to set data in a specific document within the collection.

Parameters:

  • id: The ID or path of the document to be updated.
  • data: The data to be set in the document.

Example:

collectionRef.set('123', {'name': 'John', 'age': 31});

Implementation

void set(String id, Data data) => document(id).set(data);