set<T> method
- DocumentReference<
T> docRef, - T data,
- [SetOptions? options]
Queues a set operation for the given document.
Parameters:
docRef: The document reference.data: The data to set.options: Optional set options (e.g., merge).
Example:
batch.set(docRef, {'field': 'value'}, SetOptions(merge: true));
Implementation
void set<T>(DocumentReference<T> docRef, T data, [SetOptions? options]) {
options ??= SetOptions(merge: false);
__operations.add(
{"method": "set", "docRef": docRef, "data": data, "options": options});
}