Save

Multiple key and value as long as the direct increase in set behind.

query.use("collection name").set("key", "value").save()
query.use("collection name").set("key", "value").set("key2", "value2").save()

Support inserting object and automatically converting Bean object.

query.use("collection name").set(Object).save()

If the bean object contains a special format such as time, it is recommended to use setx.

query.use("collection name").setx(Object).save()

Gets the ID inserting the data successfully.

Use the query object just inserted , query.getID()

Batch insertion

Use “add” to add, and then use “saveList” to save.

 query.use("item").add(new MongoQuery().set("a", "1").set("b", "2")).add(new MongoQuery().set("a", "1").set("b", "3")).saveList();

If the batch insertion data is not sorted, you can use the quick insertion settings to save quickly.

 query.use("item").add(new MongoQuery().set("a", "1").set("b", "2")).saveList(true);

results matching ""

    No results matching ""