Search code examples
rmongodbrmongodb

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",
                      password="password", db="dbname",
                      timeout = 10L)

MongoDB is installed locally, and the misterious side of the question is that the connection works using the command line tool. The call looks like this:

mongo host:port/dbname -u username -p password
MongoDB shell version: 3.2.1
connecting to: ...

I've also tried RMongo but didn't work either. Using OSX and R version 3.2.0.


Solution

  • rmongodb doesn't support SCRAM-SHA-1 authentication. see https://github.com/mongosoup/rmongodb/issues/77. Check mongolite package.