Метод выполняет конкатенацию значений строковых полей.
const rows = await Application.batch() .update() .set('str', (f, op) => op.concat('_', f.str, '_')) .all();
Метод увеличивает значение поля типа Число.
const rows = await Application.batch() .update() .set('number', (f, op) => op.inc(f.number, 10)) .all();
Метод добавляет элемент в конец массива.
const rows = await Application.batch() .update() .set('users', (f, op) => op.push(user)) .all();
Метод удаляет элементы из массива.
const rows = await Application.batch() .update() .set('users', (f, op) => op.remove(user)) .all();
Ваш отзыв успешно отправлен!
Объект с операциями, доступными для массового обновления
Hierarchy
Methods
concat
Метод выполняет конкатенацию значений строковых полей.
const rows = await Application.batch() .update() .set('str', (f, op) => op.concat('_', f.str, '_')) .all();Parameters
Rest ...args: (TString | UpdateFieldOperand<TString>)[]
Returns UpdateConcatOperation
inc
Метод увеличивает значение поля типа Число.
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
Метод добавляет элемент в конец массива.
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
Метод удаляет элементы из массива.
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>