add method

void add(
  1. Data data
)

Method to add a new document to the collection.

Parameters:

  • data: The data to be added to the new document.

Example:

collectionRef.add({'name': 'John', 'age': 30});

Implementation

void add(Data data) => set(id, data);