<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mongodb-bson-document.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'mongodb-bson-document.fromjson.php',
    1 => 'MongoDB\\BSON\\Document::fromJSON',
    2 => 'Construct a new document instance from a JSON string',
  ),
  'up' => 
  array (
    0 => 'class.mongodb-bson-document.php',
    1 => 'MongoDB\\BSON\\Document',
  ),
  'prev' => 
  array (
    0 => 'mongodb-bson-document.frombson.php',
    1 => 'MongoDB\\BSON\\Document::fromBSON',
  ),
  'next' => 
  array (
    0 => 'mongodb-bson-document.fromphp.php',
    1 => 'MongoDB\\BSON\\Document::fromPHP',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mongodb/bson/document/fromjson.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mongodb-bson-document.fromjson" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\BSON\Document::fromJSON</h1>
  <p class="verinfo">(mongodb &gt;=1.16.0)</p><p class="refpurpose"><span class="refname">MongoDB\BSON\Document::fromJSON</span> &mdash; <span class="dc-title">Construct a new document instance from a JSON string</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-bson-document.fromjson-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">static</span> <span class="modifier">public</span> <span class="methodname"><strong>MongoDB\BSON\Document::fromJSON</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$json</code></span>): <span class="type"><a href="class.mongodb-bson-document.php" class="type MongoDB\BSON\Document">MongoDB\BSON\Document</a></span></div>

  <p class="para rdfs-comment">
   Converts an
   <a href="https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/" class="link external">&raquo;&nbsp;extended JSON</a>
   string to its BSON representation.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-bson-document.fromjson-parameters">
  <h3 class="title">Параметри</h3>
  <dl>
   
    <dt><code class="parameter">json</code> (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>)</dt>
    <dd>
     <p class="para">
      JSON value to be converted.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongodb-bson-document.fromjson-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns a new <span class="classname"><a href="class.mongodb-bson-document.php" class="classname">MongoDB\BSON\Document</a></span> instance.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-bson-document.fromjson-errors">
  <h3 class="title">Помилки/виключення</h3>
  <ul class="simplelist">
   <li>У разі помилки обробки параметрів
викидається
<span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.php" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span>.</li>
   <li>
    Throws
    <span class="classname"><a href="class.mongodb-driver-exception-unexpectedvalueexception.php" class="classname">MongoDB\Driver\Exception\UnexpectedValueException</a></span> if
    the JSON value cannot be converted to a BSON document (e.g. due to a syntax
    error).
   </li>
  </ul>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongodb-bson-document.fromjson-seealso">
  <h3 class="title">Прогляньте також</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="mongodb-bson-document.fromphp.php" class="methodname" rel="rdfs-seeAlso">MongoDB\BSON\Document::fromPHP()</a> - Construct a new document instance from PHP data</span></li>
   <li><span class="methodname"><a href="mongodb-bson-document.frombson.php" class="methodname" rel="rdfs-seeAlso">MongoDB\BSON\Document::fromBSON()</a> - Construct a new document instance from a BSON string</span></li>
   <li><a href="https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/" class="link external">&raquo;&nbsp;MongoDB Extended JSON</a></li>
   <li><a href="https://www.mongodb.com/docs/manual/reference/bson-types/" class="link external">&raquo;&nbsp;BSON Types</a></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>