Questions tagged [mongolite]

High-level, high-performance MongoDB client for R based on libmongoc and jsonlite.

103 questions
8
votes
1 answer

R : Updating an entry in mongodb using mongolite

I have a mongo database with information that I am passing to some R scripts for analysis. I am currently using the mongolite package to pass the information from mongo to R. I have a field in each mongo entry called checkedByR, which is a binary…
Futh
  • 129
  • 1
  • 9
7
votes
0 answers

mongolite best practices

I am developing an application using OpenCPU and R, I am totally new to both. I am using mongolite package to connect to MongoDB. There are multiple calls to the DB and connecting every time, takes really long. Plus data processing, plotting etc.…
AGA
  • 71
  • 2
6
votes
1 answer

Connection to MongoDB Atlas via Shinyapps.io

I tried to connect my shiny app to mongodb server. I deployed app on shinyapps.io but got error again and again: 2019-10-22T18:14:14.694520+00:00 shinyapps[1117463]: Listening on http://127.0.0.1:36739 2019-10-22T18:14:36.665309+00:00…
Dynortice
  • 93
  • 9
6
votes
3 answers

Get ObjectID in mongolite R library

I can successfully retrieve data from my mongoDB instance but need to re-use the objectID for a depending query. The following code seems to get my entire object but NOT the id. What am I missing? # Perform a query and retrieve data mongoOBj <-…
DirkLX
  • 1,317
  • 1
  • 10
  • 16
5
votes
0 answers

no suitable servers found when trying to connect to mongodb on R

I am receiving this error randomly after trying to connect to mongodb atlas via the mongolite package. library(mongolite) url = "myurl" data = mongo(collection = "mycollection", db = "mydb", url = url) Error: No suitable servers found…
niceguy
  • 137
  • 6
5
votes
2 answers

Use Rs mongolite to correctly (insert? update?) add data to existing collection

I have the following function written in R that (I think) is doing a poor job of updating my mongo databases collections. library(mongolite) con <- mongolite::mongo(collection = "mongo_collection_1", db = 'mydb', url = 'myurl') myRdataframe1 <-…
Canovice
  • 9,012
  • 22
  • 93
  • 211
5
votes
1 answer

regex with mongolite in R

Trying to do a regex match with the awesome mongolite library and I am still not sure what I am doing wrong, going really nuts on what am i missing here. library(mongolite) m <- mongo(url = "mongodb://192.168.1.5:27017", db = "products", collection…
Kate K
  • 175
  • 7
4
votes
3 answers

Mongolite Error: Failed to read 4 bytes: socket error or timeout

I was trying to query a mongo database for all of the id's included in the database so I could compare the list to a separate data frame. However, when I attempt to find all sample_id fields I'm presented with: Error: Failed to read 4 bytes:…
jasbner
  • 2,253
  • 12
  • 24
4
votes
1 answer

R -How to pass value in mongolite Query

I'm using mongolite package to connect and retrieve data from MongoDB.How to pass value in mongolite find query ##connecting mongodb library(mongolite) mongo<-mongolite::mongo(collection = "Sample", db = "Test", url = …
kannan k
  • 145
  • 1
  • 2
  • 9
4
votes
0 answers

Unique index with mongolite

I see that we can add an index by simply specifying the name of the field: library(mongolite) m <- mongo() m$index("field") How do we specify a unique index? ie: db.members.createIndex( { "field": 1 }, { unique: true } )
Brandon Bertelsen
  • 43,807
  • 34
  • 160
  • 255
3
votes
1 answer

Connect To Amazon DocumentDB with R Mongolite

I Have my own AWS DocumentDB and I'm trying to connect to it in R using Mongolite Package I tried to do this with mongolite ssl_options with this code: mong <- mongo(collection = "test", db = "test" ,url…
omarahmedm93
  • 71
  • 1
  • 8
3
votes
0 answers

How do I add a variable index in mongolite

R version: 3.4.2, Ubuntu 16.04 LTS (4.10.0-37-generic), Mongo DB version 3.4.10, Mongolite v1.2. Based off of Mongolite manual, I am trying to add an index based off my data in R. I would like this index to take up the value based on a variable's…
Vinnie
  • 35
  • 4
3
votes
0 answers

Mongolite query returns invalid json because of quotes

I have a large amount of articles in a mongo db and I want to load only a part of them in a R session (using mongolite), as I already have a subset of all the titles (there is a field "title" in my collection). Thus, I'd like to use $in in order to…
3
votes
1 answer

How to update an array of subdocuments with R mongolite?

I am using R mongolite to read and write in a mongo collection with the following structure : [{_id: 1, name: a, sites: [ {ref: site_a1}, {ref: site_a2} ]}, {_id: 2, name: b, sites: [ {ref: site_b1}, {ref: site_b2} ]}, {_id: 3, name: c,…
vwrobel
  • 1,706
  • 15
  • 25
3
votes
2 answers

Mongolite and aggregation with $lookup on ObjectId vs character

Working with mongolite v0.9.1 (R) and MongoDB v3.4, I'd like to join two collections, the first one, the parent containing an ObjectId, the second one, the children containing the string value of the parents' ObjectId. This is the basic syntax…
jeanjerome
  • 98
  • 8
1
2 3 4 5 6 7