Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 941 Bytes

updatebuilder-math.md

File metadata and controls

69 lines (53 loc) · 941 Bytes
description
Updates can also contain Math operations

UpdateBuilder - Math

Increment (Add)

economy.update(((query, update) -> {
    // [...]
    update.inc("field", 100);
})).execute();

Decrement (Remove)

economy.update(((query, update) -> {
    // [...]
    update.decr("field", 100);
})).execute();

Multiply

economy.update(((query, update) -> {
    // [...]
    update.mul("field", 100);
})).execute();

Divide

economy.update(((query, update) -> {
    // [...]
    update.div("field", 100);
})).execute();

Increment

economy.update(((query, update) -> {
    // [...]
    update.inc("field", 100);
})).execute();

Min

economy.update(((query, update) -> {
    // [...]
    update.min("field", 100);
})).execute();

Max

economy.update(((query, update) -> {
    // [...]
    update.max("field", 100);
})).execute();