mongolite
mongolite copied to clipboard
Having trouble query based on a list in R using mongolite
I'm using mongolite in R to query data. Now I have a list called "my_list", and I'd like to query a field in mongoDB based on items in my_list.
For example:
my_list = list( "process", "check", "queue" )
values <- mongo$find('{"field" : { "$in" : my_list } }')
Ideally it would return fields equals to "process", "check" and "queue". I've done this in python, but I don't know how to achieve this using R. Please send help... Thanks!
The best way to go about this is using the paste0 function.
See this StackOverflow post on how to use the function in this context.