tc / RMongo

R client to interface with MongoDB
102 stars 34 forks source link

Variable value in dbGetQuery 'query' argument #41

Closed teena-k closed 8 years ago

teena-k commented 8 years ago

I have been searching online a lot to find how a variable value in R can be used to query a mongoDB collection using dbGetQuery. All examples of dbGetQuery contain static (constant) values only as in the below query.

dbGetQuery(mongo, "test_data", '{"foo": "bar"}')

In this query, 'bar' is a constant. How should I query if I need to use the value in a variable named 'bar'?