Open Ankitmaroo opened 10 years ago
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
mongo <- mongo.create(host = "SDMongo01", username = "svc", password = "xyz", db = "Services") if (mongo.is.connected(mongo)){
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
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
But similiar query using rmongodb works.
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