MongoDB\BSON\Document::fromJSON

Construct a new document instance from a JSON string

説明

final static public MongoDB\BSON\Document MongoDB\BSON\Document::fromJSON(string $json)

Converts an » extended JSON string to its BSON representation.

パラメータ

json (string)

JSON value to be converted.

エラー / 例外

  • Throws MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors.
  • Throws MongoDB\Driver\Exception\UnexpectedValueException if json is not a valid document.

参考