Questions tagged [rmongo]

RMongo is a R package which lets you query MongoDB databases.

37 questions
12
votes
3 answers

How to query MongoDB from R?

I want to get a MongoDB query from R. With the mongo shell, I would query with: db.user.find({age:{$gt:21}}) However, In R-Mongo, I haven't found how to describe this query. Thanks
user189594
  • 191
  • 2
  • 6
6
votes
1 answer

Which package to use to connect R with MongoDB?

I wonder what are the main differences between rmongodb and RMongo packages for connecting R with MongoDB. What are the advantages and disadvantages of these two packages?
AnjaM
  • 2,941
  • 8
  • 39
  • 62
6
votes
3 answers

Querying RMongo with ObjectId

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?
Dan Blum
  • 61
  • 3
5
votes
0 answers

RMongo dbGetQueryForKeys returns NA

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…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
4
votes
1 answer

Passing mongodb ISODate in R

I'm currently pulling my data into R with the RMongo package. I want to specify the date range that should be pulled in my R session at this point with library('RMongo') #Connect to the database mongo <- mongoDbConnect('db') #results from dates.…
ngamita
  • 329
  • 2
  • 12
2
votes
1 answer

Querying a MongoDB database using a list of values

I have a database of cricket matches where each match has been assigned a unique MatchId. I have a list which contains the Matchids of a few select matches that I need to query from the MongoDB database named "id_list" the query i use in pymongo on…
2
votes
2 answers

mongolite filtering with dynamic array in r shiny

I have a select input with multiple options and my Mongo query Here is the array if elements: c<- c("elen","shallen") query1 <- paste0('{"client": {"$in"["',c,'"]}') #sales info is the data base salesinfo$find(fields =…
2
votes
1 answer

How to list mongodb collections in R

I have been trying to list collections within a mongo database in R. I have realized that this feature is still in the to do list in the mongolite package (https://github.com/jeroen/mongolite/issues/86). There seemed to be a package, rmongodb,…
deann
  • 756
  • 9
  • 24
2
votes
1 answer

How to calculate the average of particular column using RMongo?

This code shows how I do it in Pymongo but what if I wanted to do that in RMongo? from pymongo import MongoClient connection = MongoClient() db = connection.mydb collection = db.transactions pipe = [{'$group': {'_id': 'TRANS_AMNT_AVG', 'average':…
Dawid Stan
  • 21
  • 2
2
votes
2 answers

How do you bulk insert documents in MongoDB from R?

I have a dataframe in R and I am trying to bulk insert each row of the dataframe as separate document in MongoDB. The closest I could do is using following script which creates a document and makes the rows of dataframe as its sub document. x <-…
Kshitij Dixit
  • 71
  • 1
  • 6
2
votes
3 answers

How to install RMongo package in R

I have installed R 3.1.2. I want to install RMongo package so that I can access my mongoDB database.I have downloaded RMongo-master.zip file from GitHub. But I am not able to install this package. Please help me.
manishankar
  • 35
  • 1
  • 5
2
votes
1 answer

JSON Parse Error in MongoDB and R

I am new to R and MongoDB and everything related to programming so please bear with me. I am trying to query a MongoDB database based on user input (dropdown menu). When I run the code, I get the following error: Error:…
2
votes
1 answer

How to send multiple documents using RMongo

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)) …
RockScience
  • 17,932
  • 26
  • 89
  • 125
2
votes
1 answer

Return strings as strings instead of integers in RMongo?

I run the following Query in RMongo: > test <- dbGetQuery(db,'mycollection', '{"zip" : "06840"}', skip=0,limit=1e10) > test update zip 1 2013-03-11 6840 The item is stored in MongoDB, with leading zeros, as a string, and RMongo is able to…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
2
votes
1 answer

rmongo and query-ing

I have difficulty with writing query via rmongo .. mongo <- mongoDbConnect(dbName="baba", host="inja.com",port='27017') dbAuthenticate(mongo, 'alaki', 'dolaki') dbShowCollections(mongo) > Acol Bcol Ccol Dcol now : result = dbGetQuery(mongo,…
Areza
  • 5,623
  • 7
  • 48
  • 79
1
2 3