j = { name : "mongo" };
t = { x : 3 };
> db.things.save(j); > db.things.save(t); > db.things.find(); 批量插入。
for (var i = 1; i <= 20; i++) db.things.save({x : 4, j : i}); > db.things.find(); 查询个数限制
db.things.find().limit(3);
----
var cursor = db.things.find(); > while (cursor.hasNext()) printjson(cursor.next());
db.things.find().forEach(printjson);
var arr = db.things.find().toArray();
时间: 2024-10-11 03:56:55