比如说我往mongoDB中插入一组数据,如下:
BasicDBObject basic=new BasicDBObject();
basic.put("userId", 1);
BasicDBObject info = new BasicDBObject();
info.put("name", "lee");
info.put("age", 21);
basic.put("info", info);
collection.insert(basic);
现要根据info中的条件去查询出来,searchQuery中如何写呢?该回复于2011-07-13 15:53:41被版主删除再追加一个问题
如何从mongo查出符合条件的前X条数据? 就像mysql里的limithttp://www.cnblogs.com/hoojo/archive/2011/06/02/2068665