rmongodb

When using rmongodb, unable to see collections in mongoDB

烂漫一生 提交于 2019-12-06 16:06:32
I am having the same issue as in this thread: Unable to see collections in mongo DB when connected through R I am successfully connected to mongoDB. > mongo.is.connected(mongo) [1] TRUE If I run the following code, I see the correct db. > mongo.get.databases(mongo) [1] "FF" > But, when I try to view the collections, it returns character(0) > mongo.get.database.collections(mongo , db = "FF") character(0) > If I connect from the shell I can see all the collections, so I know they exist. > use FF switched to db FF > show collections kelp_classifications kelp_groups kelp_subjects kelp_users Update

Connecting to MongoDB replica set with rmongodb

限于喜欢 提交于 2019-12-06 14:57:52
问题 Has anyone been able to connect to a MongoDB replica set using rmongodb ? No matter how I configure mongo.create I get an authentication error, even though the same host/username/password work fine when connecting via the mongo shell. My code does the equivalent of: > mongo.create(c("rs-1.mysite.com:12345","rs-2.mysite.com:12345"), "rsName", "user", "password", "my_db") Unable to connect to replset Authentication failed. Update: Looking at the logs of all the nodes in the replica set, I do

speed up large result set processing using rmongodb

*爱你&永不变心* 提交于 2019-12-03 14:36:27
I'm using rmongodb to get every document in a a particular collection. It works but I'm working with millions of small documents, potentially 100M or more. I'm using the method suggested by the author on the website: cnub.org/rmongodb.ashx count <- mongo.count(mongo, ns, query) cursor <- mongo.find(mongo, query) name <- vector("character", count) age <- vector("numeric", count) i <- 1 while (mongo.cursor.next(cursor)) { b <- mongo.cursor.value(cursor) name[i] <- mongo.bson.value(b, "name") age[i] <- mongo.bson.value(b, "age") i <- i + 1 } df <- as.data.frame(list(name=name, age=age)) This

rmongodb authentication always fails [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-12-02 06:53:39
This question already has an answer here: rmongodb support for MongoDB 3 2 answers I'm trying to login using rmongodb and it does not authenticate. Here's my connection string: myMongoConnection <- mongo.create(host = "<myip>",db = "geoLoc", username = "<myusername>", password = "<mypassword>") However, if I open a mongo shell on my computer and type: mongo <myip>/geoLoc -u '<myusername>' -p '<mypassword>' it connects just fine. Moreover, if I log into the server and disable authentication by commenting out: auth = true , and then try: myMongoConnection <- mongo.create(host = "<myip>",db =

Unable to see collections in mongo DB when connected through R

て烟熏妆下的殇ゞ 提交于 2019-12-02 04:25:53
I used "rmongodb" package to connect to mongo DB through R. The connection is successful. > mongo.is.connected(mongo) [1] TRUE > If I check at the host where mongoDB is running. > use reporting switched to db reporting > show collections MongoIndexing details test > But from R > mongo.get.database.collections(mongo , db="reporting") character(0) > The below code will return an array of collection names iff the provided database has collections in it. Otherwise, it will return character(0) try this: mongo <- mongo.create(host="127.0.0.1:27017" , db="sample") mongo.get.database.collections(mongo

rmongodb support for MongoDB 3

心不动则不痛 提交于 2019-12-02 00:43:55
问题 I am building a R script in which I need to connect to MongoDB through authentication and process the data fetched from database using rmongodb package.For that I have created a new MongoDB user in version 3.0.4 and while connecting to mongoDB from R script authentication fails. Also the user is authenticated successfully through mongo shell. Also authentication works fine while I authenticate user created in MongoDB version 2.x. Following is code snippet which we have used in R script to

rmongodb support for MongoDB 3

烈酒焚心 提交于 2019-12-01 20:30:36
I am building a R script in which I need to connect to MongoDB through authentication and process the data fetched from database using rmongodb package.For that I have created a new MongoDB user in version 3.0.4 and while connecting to mongoDB from R script authentication fails. Also the user is authenticated successfully through mongo shell. Also authentication works fine while I authenticate user created in MongoDB version 2.x. Following is code snippet which we have used in R script to connect to Mongo database. mongo <- mongo.create("127.0.0.1", "", "user", "pass", "db", 0L ) While

Running advanced MongoDB queries in R with rmongodb

妖精的绣舞 提交于 2019-11-30 13:05:40
问题 As MySQL is driving me nuts I'm trying to make myself acquainted with my first "NoSQL" DBMS and it happened to be MongoDB. I'm connecting to it via rmongodb. The more I play around with rmongodb, the more questions/problems come up with respect to running advanced queries. First I present some example data before I go into detail about the different types of queries that I can't seem to specify correctly. Example Data The example is taken from the MongoDB website and has been simplified a bit

Transfer large MongoDB collections to data.frame in R with rmongodb and plyr

狂风中的少年 提交于 2019-11-30 10:33:12
I have some strange results with huge collections sets when trying to transfer as data frames from MongoDB to R with rmongodb and plyr packages. I pick up this code from various github and forums on the subject, and adapt it for my purposes : ## load the both packages library(rmongodb) library(plyr) ## connect to MongoDB mongo <- mongo.create(host="localhost") # [1] TRUE ## get the list of the databases mongo.get.databases(mongo) # list of databases (with mydatabase) ## get the list of the collections of mydatabase mongo.get.collections(mongo, db = "mydatabase") # list of all the collections

Running advanced MongoDB queries in R with rmongodb

China☆狼群 提交于 2019-11-30 05:27:49
As MySQL is driving me nuts I'm trying to make myself acquainted with my first "NoSQL" DBMS and it happened to be MongoDB . I'm connecting to it via rmongodb . The more I play around with rmongodb , the more questions/problems come up with respect to running advanced queries. First I present some example data before I go into detail about the different types of queries that I can't seem to specify correctly. Example Data The example is taken from the MongoDB website and has been simplified a bit. pkg <- "rmongodb" if (!require(pkg, character.only=TRUE)) { install.packages(pkg) require(pkg,