dbInsertDocument-methods: Insert a document into a MongoDB collection

Description Usage Arguments See Also Examples

Description

Insert a json character object into the mongodb collection.

Usage

1
  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

1
2
3
  mongo <- mongoDbConnect("test")
  output <- dbInsertDocument(mongo, "test_data", '{"foo": "bar"}')
  dbDisconnect(mongo)

tc/RMongo documentation built on May 31, 2019, 7:27 a.m.