$inc
Update records by incrementing the value of a numeric column. The $inc method is used to increase the existing value of a column by a specified amount, typically used for fields like counters, quantities, or numeric metrics that need to be updated incrementally.
await Member.$update({
$where: {
age: {
$eq: 16
}
},
$update: {
$inc: {
age: 4
}
}
});
Last updated