js-bao-wss-client / MutationOperation
Interface: MutationOperation
A single write inside a mutation definition's operations array.
Properties
condition?
optionalcondition?:Record<string,any>
A structured DocumentFilter object gating the write — the compare-and-swap precondition. Applies to EVERY op kind (save/patch/delete/increment/addToSet/removeFromSet); the server checks it atomically and returns 409 code:"CONDITION_NOT_MET" when it does not hold. Values may be $params.<name> references resolved at execution time (e.g. { version: "$params.expectedVersion" }).
BREAKING (was condition?: string, "save only"): the old CEL-string form is rejected at registration — it never worked (it returned HTTP 500 on every execute). Author conditions as filter objects.
data?
optionaldata?:ObjectOrParamsRef
Record data for save/patch (object or $params reference).
fields?
optionalfields?:ObjectOrParamsRef
Field → increment amount for increment (object or $params reference).
id?
optionalid?:string
Target record id (required for patch/delete/increment/addToSet/removeFromSet).
ifNotExists?
optionalifNotExists?:boolean
save only: skip when the record already exists.
op
op:
"save"|"patch"|"delete"|"increment"|"addToSet"|"removeFromSet"
stringSets?
optionalstringSets?:ObjectOrParamsRef
Field → string-set members for addToSet/removeFromSet (object or $params).
upsertOn?
optionalupsertOn?:string
save only: field name (or $params reference) to upsert on.