I'm able to connect via the mongosh shell and query documents for an easy count. Specifically,
$ mongosh "mongodb+srv://<MYFEED>.mongodb.net" --apiVersion 1 --username <ME>
Enter password: ****************
Current Mongosh Log ID: <MYLOGID>
Connecting to: mongodb+srv://<credentials>@<MYFEED>.mongodb.net/?appName=mongosh+1.8.2
Using MongoDB: 6.3.1 (API Version 1)
Using Mongosh: 1.8.2
Atlas test> use mydb
switched to db mydb
Atlas erdp> db.raw.count({"sessionInfo.sessionId":"a7983927-9f8e-ed11-a2e9-d094661ab20e","type":"location"})
DeprecationWarning: Collection.count() is deprecated. Use countDocuments or estimatedDocumentCount.
748443
but connecting to the same server, same username/password, same collection/db does not work:
M <- mongolite::mongo(collection = "mydb", db = "raw",
url = sprintf(
"mongodb+srv://%s:%s@<MYFEED>.mongodb.net",
"<ME>", "<MYPASS>"))
M$count('{"sessionInfo.sessionId":"a7983927-9f8e-ed11-a2e9-d094661ab20e","type":"location"}')
# [1] 0
What can I check to see why the R connection finds nothing? (I realize you cannot connect/check this collection.)
I'm able to connect via the
mongosh
shell and query documents for an easy count. Specifically,but connecting to the same server, same username/password, same collection/db does not work:
What can I check to see why the R connection finds nothing? (I realize you cannot connect/check this collection.)