Update

Just add “modify” directly after the condition to update the operation. Multiple update with the same number of “modify”.

query.use("item").byId("5710a81ab73a87092e17a02b").modify("b","3").update()
query.use("item").eq("a","1").modify("b","3").update()
query.use("item").eq("a","1").modify("a","2").modify("b","3").update()

The 1.0.5 version supports updating object mode, and if “value” is empty or no content, it will not update this value. It is suitable for putting into bean object directly.

 query.use("item").eq("a","1").modify(object).update()

1.0.7.1 version supports direct replacement

 query.use("item").eq("a","1").replace(obj)

Update operation defaults to batch, so all rows that meeting the conditions will be updated. Suggest using at least one unique field or a detailed condition. If you need to drive the native Updates Model, directly run “add (Updates Model)”.

In order to facilitate everyone’s usage, built in self enhancement.

query.use("item").eq("a",1).inc("a",1).update()

If you only want to update one, run “updateOne ()”.

results matching ""

    No results matching ""