Update tojson.xml fix code example

This commit is contained in:
Mikhail Alferov
2024-10-14 01:18:20 +03:00
committed by GitHub
parent af20777111
commit dbbada8ea8

View File

@ -90,7 +90,8 @@
&reftitle.examples;
<example>
<title>
Пример преобразования BSON-значение в Legacy Extended JSON-представление методом <function>MongoDB\BSON\toJSON</function>
Пример преобразования BSON-значения в Legacy Extended JSON-представление
методом <function>MongoDB\BSON\toJSON</function>
</title>
<programlisting role="php">
<![CDATA[
@ -102,7 +103,7 @@ $documents = [
['string' => 'foo'],
['int32' => 123],
['int64' => 4294967295],
['double' => 1.0,],
['double' => 1.0],
['nan' => NAN],
['pos_inf' => INF],
['neg_inf' => -INF],
@ -114,8 +115,17 @@ $documents = [
['date' => new MongoDB\BSON\UTCDateTime(1445990400000)],
['timestamp' => new MongoDB\BSON\Timestamp(1234, 5678)],
['regex' => new MongoDB\BSON\Regex('pattern', 'i')],
['code' => new MongoDB\BSON\Javascript('function() { return 1; }')],
['code_ws' => new MongoDB\BSON\Javascript('function() { return a; }', ['a' => 1])],
['code' => new MongoDB\BSON\Javascript(
'function() {
return 1;
}'
)],
['code_ws' => new MongoDB\BSON\Javascript(
'function() {
return a;
}',
['a' => 1]
)],
['minkey' => new MongoDB\BSON\MinKey],
['maxkey' => new MongoDB\BSON\MaxKey],
];