mongodb Cursor

文章来自我的博客:https://www.lwxshow.com/db/mongo/mongodb-cursor.html

mongodb游标

#定义游标

> var x=db.cuser.find(); 

#判断是否有数据
> h.hasNext();
Mon May 27 01:53:19.561 JavaScript execution failed: ReferenceError: h is not defined
> x.hasNext();
true

#为true的话往下查询.


> x.next();
{
"_id" : ObjectId("51a23348ea214a8ee3204de2"),
"name" : "userid_2",
"pwd" : "pwd_2",


你可能感兴趣的:(mongodb,游标,Cursor,lwxshow,舍得Share)