Can't insert R variable through dbInsertDocument()
rootkea opened this issue · comments
Avinash Sonawane commented
script.R
rootkea <- mongoDbConnect('rootkea')
var <- "foo@bar.com"
dbInsertDocument(rootkea, "result", '{"email": var}')
Output:
$ Rscript script.R
Loading required package: rJava
Loading required package: methods
Error in .jcall(rmongo.object@javaMongo, "S", "dbInsertDocument", collection, :
com.mongodb.util.JSONParseException:
{"email": var}
^
Calls: dbInsertDocument -> dbInsertDocument -> .jcall -> .jcheck -> .Call
Execution halted
Avinash Sonawane commented
Closing this one as found same solved issue #26