Description Usage Arguments Details Value See Also Examples
mongo.cursor.next(cursor)
is used to step to the first or next
record.
1 | mongo.cursor.next(cursor)
|
cursor |
(mongo.cursor) A mongo.cursor object returned from
|
mongo.cursor.value(cursor)
may then be used to examine it.
TRUE if there is a next record; otherwise, FALSE.
mongo.find
,
mongo.cursor,
mongo.cursor.value
,
mongo.cursor.destroy
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "city", "St. Louis")
query <- mongo.bson.from.buffer(buf)
# Find the first 1000 records in collection people
# of database test where city == "St. Louis"
cursor <- mongo.find(mongo, "test.people", query, limit=1000L)
# Step though the matching records and display them
while (mongo.cursor.next(cursor))
print(mongo.cursor.value(cursor))
mongo.cursor.destroy(cursor)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.