Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions reference/mongodb/bson/document/fromjson.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<simpara>
Returns a new <classname>MongoDB\BSON\Document</classname> instance.
</simpara>
&mongodb.note.duplicate-keys.fromjson;
</refsect1>

<refsect1 role="errors">
Expand Down
6 changes: 6 additions & 0 deletions reference/mongodb/bson/document/get.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
<classname>MongoDB\BSON\Int64</classname> instance.
</simpara>
</note>
<note>
<simpara>
If the document contains duplicate keys, the value of the first matching key
is returned.
</simpara>
</note>
</refsect1>

<refsect1 role="errors">
Expand Down
6 changes: 6 additions & 0 deletions reference/mongodb/bson/document/getiterator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
Returns a <classname>MongoDB\BSON\Iterator</classname> instance that can be
used to iterate over all keys in the document.
</simpara>
<note>
<simpara>
If the document contains duplicate keys, the iterator returns every
element in the original order.
</simpara>
</note>
</refsect1>

<refsect1 role="errors">
Expand Down
6 changes: 6 additions & 0 deletions reference/mongodb/bson/document/offsetget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
<classname>MongoDB\BSON\Int64</classname> instance.
</simpara>
</note>
<note>
<simpara>
If the document contains duplicate keys, the value of the first matching key
is returned.
</simpara>
</note>
</refsect1>

<refsect1 role="errors">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<link xlink:href="&url.mongodb.specs.extendedjson;#canonical-extended-json-example">Canonical Extended JSON</link>
representation of the BSON document.
</simpara>
&mongodb.note.duplicate-keys.tojson;
</refsect1>

<refsect1 role="examples">
Expand Down
1 change: 1 addition & 0 deletions reference/mongodb/bson/document/torelaxedextendedjson.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<link xlink:href="&url.mongodb.specs.extendedjson;#relaxed-extended-json-example">Relaxed Extended JSON</link>
representation of the BSON document.
</simpara>
&mongodb.note.duplicate-keys.tojson;
</refsect1>

<refsect1 role="examples">
Expand Down
25 changes: 21 additions & 4 deletions reference/mongodb/entities.mongodb.ent
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,23 @@ local: {
</note>
</entity>

<entity name="mongodb.note.duplicate-keys.tojson">
<note>
<simpara>
If the BSON document contains duplicate keys, all of them are preserved in
the JSON output.
</simpara>
</note>
</entity>

<entity name="mongodb.note.duplicate-keys.fromjson">
<note>
<simpara>
Duplicate keys in the JSON string are preserved in the order they appear.
</simpara>
</note>
</entity>

<entity name="mongodb.note.extended-json">
<note>
<simpara>
Expand Down Expand Up @@ -816,10 +833,10 @@ local: {
<warning>
<simpara>
BSON documents can technically contain duplicate keys because documents are
stored as a list of key-value pairs; however, applications should refrain
from generating documents with duplicate keys as server and driver behavior
may be undefined. Since PHP objects and arrays cannot have duplicate keys,
data could also be lost when decoding a BSON document with duplicate keys.
stored as a list of key-value pairs; however, applications should avoid
creating documents with duplicate keys. The server and other drivers may
handle them differently, and PHP objects and arrays cannot have duplicate
keys, so data is lost when decoding a BSON document with duplicate keys.
</simpara>
</warning>
</entity>
Expand Down
1 change: 1 addition & 0 deletions reference/mongodb/functions/bson/fromjson.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<simpara>
The serialized BSON document as a binary string.
</simpara>
&mongodb.note.duplicate-keys.fromjson;
</refsect1>

<refsect1 role="errors">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<simpara>
The converted JSON value.
</simpara>
&mongodb.note.duplicate-keys.tojson;
</refsect1>

<refsect1 role="errors">
Expand Down
1 change: 1 addition & 0 deletions reference/mongodb/functions/bson/tojson.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<simpara>
The converted JSON value.
</simpara>
&mongodb.note.duplicate-keys.tojson;
</refsect1>

<refsect1 role="errors">
Expand Down
1 change: 1 addition & 0 deletions reference/mongodb/functions/bson/torelaxedextendedjson.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<simpara>
The converted JSON value.
</simpara>
&mongodb.note.duplicate-keys.tojson;
</refsect1>

<refsect1 role="errors">
Expand Down
Loading