toMongo: Export to MongoDB
Description
Exports a dataframe to a format that can be imported with the
mongoimport
command line tool included with MongoDB.Usage
toMongo(x, array = FALSE, POSIXt = "mongo", raw = "mongo", ...)
Arguments
array
if output should be an array. See details.
Details
By default mongoimport
expects a datafile in which every line is a record
in the collection. Hence the complete output is not valid JSON
itself.
Alternatively, if array=TRUE
the output will be wrapped a JSON
array.
When using the latter, we need to pass --jsonArray
to mongoimport
.