Search in sources :

Example 1 with ZMoCo

use of org.nutz.mongo.ZMoCo in project nutzboot by nutzam.

the class MainLauncher method init.

public void init() {
    ZMoCo co = zmodb.cc("user", true);
    ZMo mo = ZMo.me();
    co.insert(mo.toDoc(new User("apple", 40, "北京")));
    co.insert(mo.toDoc(new User("apple", 40, "北京")));
    co.insert(mo.toDoc(new User("ball", 30, "未知")));
    co.insert(mo.toDoc(new User("cat", 50, "温哥华")));
    co.insert(mo.toDoc(new User("fox", 51, "纽约")));
    co.insert(mo.toDoc(new User("bra", 25, "济南")));
    co.insert(mo.toDoc(new User("lina", 50, "深圳")));
}
Also used : ZMoCo(org.nutz.mongo.ZMoCo) User(io.nutz.demo.simple.bean.User) ZMo(org.nutz.mongo.ZMo)

Aggregations

User (io.nutz.demo.simple.bean.User)1 ZMo (org.nutz.mongo.ZMo)1 ZMoCo (org.nutz.mongo.ZMoCo)1