| What is Cursor in MogoDB and example
Cursor is a pointer to the result set of a query. A pointer to result set of a query. Clients can iterate through a cursor to retrieve results. and below is the example to create a Cursor in MongoDB:
var myCursorVar=db.users.find({"age":20});
while (myCursorVar.hasNext())
{
print(tojson(myCursorVar.next()));
}
| | |