rmongodb (version 1.8.0)

mongo.bson.from.JSON: Convert JSON to BSON Object

Description

Converts a JSON string to a mongo BSON object.

Usage

mongo.bson.from.JSON(JSON, simplifyVector = FALSE, ...)

Arguments

JSON
(string) A valid JSON string.
simplifyVector
(FALSE) coerse JSON arrays containing only scalars into a vector.
...
additional parameters parsed to fromJSON

Value

A BSON object.

See Also

mongo.find, mongo.bson.from.list, mongo.bson , fromJSON.

Examples

Run this code
mongo.bson.from.JSON('{"name" : "Peter"}')
mongo.bson.from.JSON('{"_id" : 1}')

Run the code above in your browser using DataLab