Closed jocca-mac closed 5 years ago
Try using root$run('{"listCollections":1}', simplify = FALSE)
. This will return the data in consistent manner.
Thank you. But I'm having a problem.. This works:
root$run('{"listCollections":1}')
But when I try adding the simplify I get this error:
root$run('{"listCollections":1}', simplify=FALSE) Error in root$run("{\"listCollections\":1}", simplify = FALSE) : unused argument (simplify = FALSE) What am I doing wrong? Thanks!
Are you sure you have the latest version of mongolite? Try install.packages("mongolite")
That worked. Thank you!
When I use root$run('{"listCollections":1}') I successfully get back a list of lists that contain (among other things) the collection names in the database. However, I then try to extract the collection names using something like: root$cursor$firstBatch$name. Sometimes that works, and sometimes it doesn't. I think the "structure" of that list of list that is returned from root$run('{"listCollections":1}') changes from day to day. What is the best way to reliably extract a vector of the just the actual collection names from that list of lists? Thanks.