我很难通过rmongo编写查询。
mongo <- mongoDbConnect(dbName="baba", host="inja.com",port='27017')
dbAuthenticate(mongo, 'alaki', 'dolaki')
dbShowCollections(mongo)
> Acol Bcol Ccol Dcol现在:
result = dbGetQuery(mongo, "settings", "{find_one()}",0,10)
> Error in .jcall(rmongo.object@javaMongo, "S", "dbGetQuery", collection, :
com.mongodb.util.JSONParseException:
{find_one()}如果有人给我一些提示,并帮助我从我的数据库中制作一个表格或R列表,我将非常感激。
发布于 2012-09-13 19:12:32
dbGetQuery()的查询参数应该是要搜索的数据,而不是find_one()。
dbGetQuery()的结果将是一个Data Frame。
示例用法:
# Find documents in "settings" collection (no query criteria); limit results to 10
result=dbGetQuery(mongo, "settings","{}",0,10)
# Find all documents that have a value of "blackbox" for the "widget" column
result=dbGetQuery(mongo, "settings","{'widget':'blackbox'}")https://stackoverflow.com/questions/12402184
复制相似问题