rmongo

Compilation failed for package 'RMongo' on Windows

吃可爱长大的小学妹 提交于 2020-01-25 03:00:06
问题 I am having trouble trying to install RMongo version 0.1.0. My code is as follows: library(devtools) install_github("tc/RMongo") The system output that I'm getting is: Downloading GitHub repo tc/RMongo@master Installing RMongo "C:/PROGRA~1/R/R-32~1.1/bin/x64/R" --no-site-file --no-environ --no-save \ --no-restore CMD INSTALL \ "C:/XX/AppData/Local/Temp/RtmpSGqhcG/devtools23d44de847da/tc-RMongo-9b6d1b1" \ --library="C:/XX/Documents/R/win-library/3.2" --install-tests * installing *source*

RMongo dbGetQueryForKeys returns NA

北战南征 提交于 2020-01-14 09:39:06
问题 I'm using the dbGetQueryForKeys function (which I learned about here), and don't seem to be getting proper return values---it collects the right keys, but the values are all NA. Here's my query in the mongo console, which produces what I expect: db.final.find({},{"ids.myid":1,"org.name":1,"_id":0}).skip(0).limit(5000) This produces the list of... {"ids" : {"myid": "123"}, "org": {"name": "Fred"}}, However, the equivalent in RMongo: dbGetQueryForKeys(db,'final', '{}','{"ids.myid":1,"org.name"

How to send multiple documents using RMongo

限于喜欢 提交于 2019-12-13 16:11:53
问题 I am following the conventions from http://docs.mongodb.org/manual/reference/method/db.collection.insert/ to send a batch of multiple documents in one call of RMongo::dbInsertDocument. data=data.frame(A=c(1,2),B=c(3,4)) L=lapply(split(data,rownames(data)),as.list) names(L)=NULL dataJSON = toJSON(L) cat(dataJSON) which gives the following result: [ { "A":1, "B":3 }, { "A":2, "B":4 } ] Then dbInsertDocument(rmongo.object=myRmongo.object, collection=myCollection, doc=dataJSON) returns the

RMongo dbGetQueryForKeys(), what is the structure of “keys,” and how do I sub-key them?

久未见 提交于 2019-12-11 09:06:43
问题 I am trying to query a mongo database from R using RMongo and return the values of a couple nested documents. Looking through the documentation for RMongo, I understand the following query: output <- dbGetQueryForKeys(mongo, 'test_data', '{"foo": "bar"}', '{"foo":1}') Where the arguments are... db = mongo collection = 'test_data' query = '{"foo": "bar"}' keys = 'Specify a set of keys to return.' What is the 1 in '{"foo":1}' ? What is the structure of this key set? Checking against this blog

Querying RMongo with ObjectId

南笙酒味 提交于 2019-12-03 21:23:28
问题 Is there a way to query in RMongo with an ObjectId? Something like: results <- dbGetQuery(mongo, "users", "{'_id': 'ObjectId('5158ce108b481836aee879f8')'}") Perhaps by importing a bson library? 回答1: RMongo's dbGetQuery() function is expecting MongoDB Extended JSON syntax for the provided query string. The MongoDB Extended JSON equivalent of ObjectId("<id>") is { "$oid": "<id>" } : results <- dbGetQuery(mongo, "users", "{'_id': { '$oid': '5158ce108b481836aee879f8' }}") 回答2: mongo.oid.from

Querying RMongo with ObjectId

北城余情 提交于 2019-11-30 23:42:59
Is there a way to query in RMongo with an ObjectId? Something like: results <- dbGetQuery(mongo, "users", "{'_id': 'ObjectId('5158ce108b481836aee879f8')'}") Perhaps by importing a bson library? RMongo's dbGetQuery() function is expecting MongoDB Extended JSON syntax for the provided query string. The MongoDB Extended JSON equivalent of ObjectId("<id>") is { "$oid": "<id>" } : results <- dbGetQuery(mongo, "users", "{'_id': { '$oid': '5158ce108b481836aee879f8' }}") mongo.oid.from.string {rmongodb} Create a mongo.oid object ftom a string Package: rmongodb Version: 1.5.3 Description Create from a