1.

What is Cursor in MogoDB and example

Answer»

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()));
}



Discussion

No Comment Found