MongoDB\BSON\fromJSONReturns the BSON representation of a JSON value
&reftitle.description;
stringMongoDB\BSON\fromJSONstringjson
Converts an
extended JSON
string to its BSON representation.
&reftitle.parameters;
json (string)
JSON value to be converted.
&reftitle.returnvalues;
The serialized BSON document as a binary string.
&reftitle.errors;
Throws
MongoDB\Driver\Exception\UnexpectedValueException if
the JSON value cannot be converted to BSON (e.g. due to a syntax error).
&reftitle.examples;
MongoDB\BSON\fromJSON example
]]>
&example.outputs;
object(MongoDB\BSON\ObjectId)#1 (1) {
["oid"]=>
string(24) "563143b280d2387c91807965"
}
}
]]>
&reftitle.seealso;
MongoDB\BSON\toJSONMongoDB Extended JSONMongoDB BSON