Learn R Programming

RMongo (version 0.0.25)

dbInsertDocument-methods: Insert a document into a MongoDB collection

Description

Insert a json character object into the mongodb collection.

Usage

dbInsertDocument(rmongo.object, collection, doc)

Arguments

rmongo.object
The RMongo object.
collection
The name of the collection the document is being inserted into.
doc
A JSON string document.

See Also

dbGetQuery-methods

Examples

Run this code
  mongo <- mongoDbConnect("test")
  output <- dbInsertDocument(mongo, "test_data", '{"foo": "bar"}')
  dbDisconnect(mongo)

Run the code above in your browser using DataLab