Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rmongo Database authentication #28

Open
Ankitmaroo opened this issue May 20, 2014 · 0 comments
Open

Rmongo Database authentication #28

Ankitmaroo opened this issue May 20, 2014 · 0 comments

Comments

@Ankitmaroo
Copy link

Hi I like to use RMongo for easier querying but having problems with connecting to database on mongo version 2.6.

The code i am to use to connect would be

port<- 27017
host <- 'SDMongo01'
db<-'Services'
user<-'svc'
pass<-'XYZ'
con <- mongoDbConnect(db,host,port)
authenticated <-dbAuthenticate(con,user,pass)
collection<-"SampleInformation"
query1 <- '{}'
query2<-'{"_id":0,"project_name":1}'
data<- dbGetQueryForKeys(con,collection,query1,query2)
Error in .jcall(rmongo.object@javaMongo, "S", "dbGetQuery", collection, :
com.mongodb.MongoException: not authorized for query on Services-Metrics-Val.SampleInformation

But similiar query using rmongodb works.

mongo <- mongo.create(host = "SDMongo01", username = "svc", password = "xyz", db = "Services")
if (mongo.is.connected(mongo)){

  • print(mongo.count(mongo, "Services-Metrics-Val.Firebrand"))
  • }
    [1] 11441

Can you tell me what I am missing? Is it something to do with new version of Mongodb?

Thanks a lot and and let me know if you need more information.

Ankit

@Ankitmaroo Ankitmaroo changed the title Rmongo Database autentication Rmongo Database authentication May 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant