CollectionWriteinterface
import { CollectionWrite } from '@mortar-kit/core'
interface CollectionWrite<F extends Fields = Fields>A write to one of a collection's documents, as the collection's canWrite sees it.
Properties
user: anyWho is writing: the user
auth.requirereturned increateContentServer(e.g. whatallowMembers({ fields })builds). Typed loosely, since collections are declared without the app's auth.action: "save" | "remove" | "move"The content server function called.
id: stringThe document's id.
doc?: Doc<Record<string, unknown>>The document being saved, as sent (save only; not validated yet).
stored: Doc<InferFields<F>> | nullThe document as stored now; null when a save creates it. Check it too, so a save can't change an owner field to get past the rule.