jeroen / mongolite

Fast and Simple MongoDB Client for R
https://jeroen.github.io/mongolite/
284 stars 64 forks source link

Adding a few admin features #215

Closed vipulg13 closed 3 years ago

vipulg13 commented 3 years ago

Dear Team,

first of all, thanks for this package!

I have a requirement in my project where I need to get the list of available databases and collections. Could you please incorporate listDatabases and listCollections methods into this package?

jeroen commented 3 years ago

Did you try running the raw command using con$run()? Maybe something like:

con <- mongo(db = "admin")
con$run("{listDatabases:1}")
vipulg13 commented 3 years ago

hello @jeroen, thanks for your reply. It worked! I somehow missed the "run" method in the documentation to run any raw command. conn$run('{"listCollections":1}')