mongo <- mongoDbConnect("test")
output <- dbInsertDocument(mongo, "test_data", '{"foo": "bar"}')
output <- dbGetQuery(mongo, 'test_data', '{"foo": "bar"}')
print(output)
output <- dbInsertDocument(mongo, "test_data", '{"foo": "bar with spaces"}')
output <- dbGetQuery(mongo, 'test_data', '{"foo": { "$regex": "bar*", "$options": "i"} }')
Run the code above in your browser using DataLab