This may be a trivial problem. I'm able to connect to remote MongoDB server. Im using mongolite for connecting to the db. My DB is mobileapps. I also don't know what to specify in 'collection'. I know I can specify any collection.
library(mongolite)
con=mongo(collection = "test", url = "mongodb://user:password@ds035965.mongolab.com:35965/mobileapps")
Though it is connecting, but doesn't show any data. Also I don't understand why does it show this for str(con): why is jeroen there.
Classes 'mongo', 'jeroen', 'environment' <environment: 0x0000000014a8ec00>
It is connecting but I am unable to see all the collections. How do I see all the collections in the db.
Also how do some basic statistics about the collection without querying like column names, types. I could only use con$count() to count the rows in the db. Something similar to db.getCollectionNames() from cmd prompt.
Update 1
I understand that I have to specify a particular collection while connecting from mongolite. But how do I connect using Rmongodb is still an issue.
mongo.create(host = "ds035965.mongolab.com", name = "MobileApp1", username = "user", password = "password ", db = "mobileapps")
This gives me an error:
Unable to connect to replset
Authentication failed.
Update 2
When I connect to my local host using rmongodb I get this error.
Error in as.environment(pos) : invalid 'pos' argument
Even though I'm able to see the db and the collection within, I still get this error. Any thoughts on what's happening?