mongo <- mongoDbConnect("test")
output <- dbInsertDocument(mongo, "test_data", '{"foo": "bar"}')
output <- dbInsertDocument(mongo, "test_data", '{"foo": "bar"}')
output <- dbGetDistinct(mongo, 'test_data', '{"foo": "bar"}')
print(output)
Run the code above in your browser using DataLab