set property

Command<({T model, String path}), void> set
latefinal

Creates or merges a document at a specific path.

Input: A record with path (full document path) and model (a T). Behavior: Writes model.toJson() at the document path, merging with existing data if present.

Implementation

late final set = Command.createAsyncNoResult<({String path, T model})>(
  (r) {
    guardAuth();
    return _ackVoid(
      fs.doc(r.path).set(r.model.toJson(), SetOptions(merge: true)),
    );
  },
);