Description Usage Arguments Details Value See Also Examples
Converts a mongo cursor object to a data.frame by interating over all cursor objects and combining them.
1 | mongo.cursor.to.data.frame(cursor, nullToNA = TRUE, ...)
|
cursor |
(mongo.cursor) A mongo.cursor object returned from
|
nullToNA |
(boolean) If |
... |
Additional parameters parsed to the function |
Note that mongo.oid columns will be removed. data.frame can not deal with them.
An R data.frame object.
1 2 3 4 5 6 7 8 9 10 11 12 13 | mongo <- mongo.create()
if (mongo.is.connected(mongo)) {
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "age", 22L)
query <- mongo.bson.from.buffer(buf)
# Find the first 100 records
# in collection people of database test where age == 22
cursor <- mongo.find(mongo, "test.people", query, limit=100L)
res <- mongo.cursor.to.data.frame(cursor)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.