Questions tagged [rmongodb]
rmongodb is a full featured driver for the R language to interface with the MongoDB database. R is an open source programming language and software environment for statistical computing and graphics.
100
questions
0
votes
1
answer
30
views
Can I execute atomic transactions with MongoDB from R?
As the title states: Is there a way with any of the mongodb-clients in R to execute atomic transactions? If so, how would I do this? I couldn't find any documentation on this topic.
0
votes
1
answer
67
views
Package log4r-mongoDB integration
I explored the log4r package and found that we have console and file appenders. I am looking for pushing the logs to a mongoDB database. I am unable to find any way in pushing the logs to mongoDB, do ...
0
votes
0
answers
17
views
Package 'rmongodb' not available for R version 3.5.0 [duplicate]
I cannot install rmongodb package with RStudio. I have IOs
When I run my app I get
Warning: Error in library: there is no package called ‘rmongodb’
51: stop
50: library
So I do:
install.packages("...
2
votes
1
answer
1k
views
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/...
0
votes
0
answers
452
views
Error: Authentication failed while connecting with mongodb in r
Trying to connect MongoDB on local machine using rmongodb
mongo <- mongo.create (host='127.0.0.1', username = "admin", password = "admin123", db = "admin")
Error: Authentication failed
I am ...
0
votes
1
answer
236
views
Avoid truncation using mongo.find.all() with rmongodb in R
I want to use mongo.find.all() to get all the records in one collection. However, I find certain fields in the results are truncated. Something like the following,
.....
$onefiled
[1] xxxxxxxx... <...
1
vote
1
answer
3k
views
RMongo: Connect to mongoDB using port forwarding
I connect to a mongodb server using port forwarding like this:
ssh -i key.pem -Nf -L 27018:xx.xxx.xxx.xxx:27017 ubuntu@xx.xxx.xxx.xxx
mongo -u user -p pass --authenticationDatabase "db" --port 27018
...
0
votes
1
answer
510
views
JSON - Character issue
I extracted some data from a mongo database using the RMongo library. I have been working with the data with no problem. However, I need to access a field that was saved, originally in the database, ...
1
vote
1
answer
1k
views
Inserting json date obeject in mongodb from R
I am trying to insert forecasted values from a forecasting model along with timestamps in mongodb from.
The following code converts the R dataframe into json and then bson. However,when the result is ...
1
vote
0
answers
61
views
How to split a large matrix into a BSON list using parLapply and rmongodb?
I have a very large matrix (16,000 by 16,000) that I need to upload into a MongoDB database. I've tried to split this matrix into a list and then use parLapply to convert to BSON. Here's my code
...
1
vote
1
answer
536
views
Get data statistics in R with rmongodb or RMongo
Using robomongo I can get basic description of the data using
db.getCollection('Exempt').stats()
but i cannot seem to get this info in nR using the rmongodb or RMongo packages.
Can anyone please ...
1
vote
1
answer
540
views
rmongodb not returning distinct values for keys
I am using R to access a MongoDb table which contain records from Google Directions API. While I am able to access the _id values, I receive an error when trying to access a different key in the ...
0
votes
1
answer
293
views
rmongodb: how to enforce field ordering by specifying in the projection query?
I have some data I am trying to retrieve from mongodb into R using rmongodb package. At some point in time, the ordering of the fields in the stored documents changed.
I am trying to force my ...
2
votes
0
answers
179
views
Rmongodb: How to include null values in a query.
I am new to working with rmongodb. Currently I'm working with some basic queries. Say I have two variables I'm interested in: Job Candidates and their GPA's. Some of their GPA's are blank as in they ...
0
votes
0
answers
102
views
How to filter collection in Mongo R driver?
I'm trying to convert a mongo collection to an R data frame. I'm using rmongodb package to do the same. I'm want to filter out the collection using the field constraint and only include collections ...
0
votes
1
answer
291
views
unable to connect to 127.0.0.1:27017 in R programming language
mangodb<-mongo.create()
This my r code. When I'm creating a connection, it raises the following error:
Unable to connect to 127.0.0.1:27017, error code = 2.
1
vote
0
answers
182
views
Unable to see any collection in rmongodb of any db [duplicate]
I have tried everything to get collections out in R, but all in vain
I have followed the following links as well:
When using rmongodb, unable to see collections in mongoDB
Unable to see collections ...
0
votes
1
answer
112
views
Warning message on running mongo.cursor.to.data.frame function in rmongodb
When I run the the query
mongo.cursor.to.data.frame(cursor)
to fetch the documents in a collection to a data frame in R using rmongodb, I am getting thewarning message:
In mongo.cursor.to.data....
3
votes
1
answer
577
views
Convert mongo objectid to string using rmongodb
I'm trying to convert a mongo collection to an R data frame.
I'm using rmongodb package to do the same.
I'm facing a problem with fields with the datatype "ObjectId" (in the code below, the column "...
0
votes
1
answer
58
views
rmongodb: substract date in aggregation
After finally figuring out how to parameterize an aggregation pipeline with a date using mongo.bson.from.list(), I've been wrangling with the snippet below to get the $min for the date difference ...
0
votes
1
answer
58
views
Use of mongo.code.create to construct array argument to $add
I have MongoDB documents like the following:
{"_id":{"$oid":"56d810f5c91e6779a38386b8"},
"timestamp": {"$numberLong":"1457000674750"}}
I am constructing an aggregration pipeline which should ...
1
vote
1
answer
173
views
Rmongodb using regex does not work as expected
I am facing an issue while querying mongodb from R(using rmongodb package) using regular expressions. Below is my code:
buf <- mongo.bson.buffer.create()
regex <- mongo.regex.create("air filter*...
0
votes
1
answer
9k
views
Connect R to remote mongoDB with rmongodb
I'm trying to connect remotely to mongoDB from R:
The credentials code to connect looks like this.
library(rmongodb)
mongo <- mongo.create(host="111.222.333.444", name='', username="username",
...
1
vote
2
answers
1k
views
When using rmongodb, unable to see collections in mongoDB
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 ...
1
vote
0
answers
75
views
utf8 conversion issue on windows using rmongodb
I am having issues receiving proper utf8 characters using rmongodb.
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: i386-w64-mingw32/i386 (32-bit)
Running under: Windows 7 x64 (build 7601) ...
0
votes
1
answer
270
views
Mongo query that matches field to any element of array
I am trying to query a Mongo Db through R (rmongodb package). i have a simple requirement:
Return records where the field "email" matches any of the emails in the vector usr$email. I think I am close ...
1
vote
1
answer
73
views
rmongodb - combine two data frames into one document in a collection
Question
Using R and rmongodb, how do I create a mongodb document from two data frames, the second of which will be an array element of the first?
Data
My first data.frame is always one row.
e.g.
...
1
vote
2
answers
1k
views
MongoDB and rmongodb. Get size of find instead of returning all results
I have a MongoDB collection with >100k documents (this number will keep growing). Each document has a few fields that are a single value, and about 50 fields that are each an array of length 1000. I ...
0
votes
0
answers
41
views
How do we find random sample of data in rmongodb? [duplicate]
I have 200GB of data in my mongo database. I have connected it to R using rmongodb.Now I want to put 1000 random records from the database into a dataframe for analyzing. How do I do that?
I want to ...
1
vote
1
answer
3k
views
Unable to see collections in mongo DB when connected through R
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 ...
0
votes
1
answer
38
views
change field type from rmongodb
I have a collection uploaded to rmongodb. The issue is that all the fields were defined as strings. Thus, my aggregations are not working properly. I've looked through the documentation and it is not ...
1
vote
0
answers
65
views
Unable to connect to Mongo DB from R : Authentication Failed [duplicate]
mongo -u User -p pass --port 2551 -authenticationDatabase=db
MongoDB shell version: 3.0.3
connecting to: 127.0.0.1:2551/test
>
Using the same username and password I get Authentication Issue in R.
...
4
votes
1
answer
514
views
long time to import data using mongo.find.all (rmongodb)
I tried to import data from mongodb to r using:
mongo.find.all(mongo, namespace, query=query,
fields= list('_id'= 0, 'entityEventName'= 1, context= 1, 'startTime'=1 ), data.frame= T)
The command ...
0
votes
1
answer
76
views
R rmongodb try() not catching error potentially caused by bad data
I am using R and rmongodb to extract data from a MongoDB NoSQL database. I put in try() logic to catch problems arise from bad data. Most of the time, try() would catch the error and skip the bad ...
1
vote
1
answer
996
views
rmongodb authentication always fails [duplicate]
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>",...
0
votes
1
answer
185
views
rmongodb $in query issues
I have really enjoyed working with rmongodb and have figured out how to do a lot of different things/combination of queries but this one still stumps me. I am trying to get all of the documents that ...
-1
votes
1
answer
75
views
Add a $hint to rmongodb query
Does anyone know how to add a hint argument to a mongo query when using the rmongodb package? Note: hint is now deprecated.
Currently I'm using the mongo.find.all query for it's simplicity rather ...
1
vote
1
answer
323
views
r - rmongodb $or query construction
Background
I have GTFS data stored in a local mongodb database.
The calendar table looks like
field | type
service_id | varchar
monday | int (0 or 1)
tuesday | int (0 or 1)
...
sunday ...
0
votes
1
answer
1k
views
Aggregate by match ObjectId in rmongodb
I have trouble with an aggregation involving an ObjectId. This are the pipelines:
{'$match' : {'likes.id' : ObjectId('50e99acfb35de75402002023')}}
{'$project' : {'likes.id' : 1, '_id' : 0}}
{'$unwind'...
0
votes
0
answers
603
views
Querying MongoDB using Dates in rmongodb aggregation
I am trying to query my MongoDB between two dates/times using rmongodb.
My document structure is as following:
{
"_id" : ObjectId("5304f93a0d5c9bf99c4e5a57"),
"field1" : 34
"field2" : 45
...
0
votes
0
answers
77
views
Querying mongoDB using R and creating different dataframes based on the distinct values in a column
I want to have different dataframes created based on the distinct values of a column while querying the MongoDB.
For example- write now i am filtering the whole collection and creating a data frame ...
0
votes
1
answer
442
views
Pass shiny UI text input into rmongodb query
Below is a simplified version of my code. I'm simply trying to get Shiny to pass an input value to an rmongodb query, run the query based on the user input, and then plot the mean of a variable. The ...
0
votes
1
answer
183
views
rmongodb query combining AND, OR, and string match
Apologies if this has already been addressed.
In mongodb, I have a database collection called "main." I can successfully run the following query from a mongodb shell:
db.main.find( {
$or ...
3
votes
2
answers
2k
views
rmongodb support for MongoDB 3
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 ...
0
votes
2
answers
1k
views
Unable to install rmongodb package in Ubuntu
I have installed R 3.02 in Ubuntu 14.04.1. I tried to install a rmongodb package, with the following command
install.packages("rmongodb")
the response I got was:
> install.packages("rmongodb")
...
2
votes
1
answer
965
views
How to query a Document by ObjectId with rmongodb
Here is what you get in mongo shell :
db.col.find(ObjectId("5571849db1969e0a6eb32731")).pretty()
{
"_id" : ObjectId("5571849db1969e0a6eb32731"),
"name" : "Some name",
"logo" : "Some logo",
...
0
votes
2
answers
571
views
How do I query using a variable value in mongodb from R?
I am new in rmongodb. I would like to make a query in one collection in MongoDB using the value of a variable. It goes like this:
OBS_ID<-"20150510120000"
QUERY_DATA<-mongo.find.all(MONGO, "...
2
votes
1
answer
2k
views
How to insert a dataframe to mongodb using rmongodb
I have following dataframe
how can I insert it to mongoDB using rmongodb?
0
votes
1
answer
46
views
Set profile level using rmongodb
Is there a way to issue the set profiling level command from R using rmongodb library?
The corresponding shell command is:
db.setProfilingLevel(1)
3
votes
0
answers
178
views
rmongodb is very slow in creating data.frame
I am using MongoDB do to tick data analysis in R. Initially I used MySQL, which worked fine, but I wanted to test MongoDB for this purpose. The data set contains about 200 million entries at the ...