The method concatenates the values of string fields.
const rows = await Application.batch() .update() . set('str', (f, op) => op.concat('_', f.str, '_')) .all();
The method increases the value of a Number field.
const rows = await Application.batch() .update() . set('number', (f, op) => op.inc(f.number, 10)) .all();
The method adds an item to the end of the array.
const rows = await Application.batch() .update() . set('users', (f, op) => op.push(user)) .all();
The method removes items from an array.
const rows = await Application.batch() .update() . set('users', (f, op) => op.remove(user)) .all();
Your review is successfully sent!
Feedback sent successfully
Object with operations available for batch update
Hierarchy
Methods
concat
The method concatenates the values of string fields.
const rows = await Application.batch() .update() . set('str', (f, op) => op.concat('_', f.str, '_')) .all();Parameters
Rest ...args: (TString | UpdateFieldOperand<TString>)[]
Returns UpdateConcatOperation
inc
The method increases the value of a Number field.
const rows = await Application.batch() .update() . set('number', (f, op) => op.inc(f.number, 10)) .all();Parameters
field: UpdateFieldOperand<TFloat>
value: TFloat
Returns UpdateIncOperation
push
The method adds an item to the end of the array.
const rows = await Application.batch() .update() . set('users', (f, op) => op.push(user)) .all();Type parameters
T: Type
Parameters
Rest ...items: T[]
Returns UpdateArrayOperation<T>
remove
The method removes items from an array.
const rows = await Application.batch() .update() . set('users', (f, op) => op.remove(user)) .all();Type parameters
T: Type
Parameters
Rest ...items: T[]
Returns UpdateArrayOperation<T>