简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM