Find file
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (25 sloc) 726 Bytes
\title{Insert a document into a MongoDB collection}
Insert a json character object into the mongodb collection.
dbInsertDocument(rmongo.object, collection, doc)
\item{rmongo.object}{The RMongo object.}
\item{collection}{The name of the collection the document is being inserted into.}
\item{doc}{A JSON string document. }
mongo <- mongoDbConnect("test")
output <- dbInsertDocument(mongo, "test_data", '{"foo": "bar"}')