Skip to content

Commit b5567eb

Browse files
committed
Add documentation warning against the use of duplicate key names
JAVA-3216
1 parent d9a6bfb commit b5567eb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/reference/content/bson/documents.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ title = "Documents"
1111

1212
The driver includes several classes and interfaces used for representing BSON documents.
1313

14+
{{% note class="important" %}}
15+
16+
The server's behavior related to duplicate key names in a document is undefined. When a
17+
document with duplicate key names is decoded, the driver will assign the last
18+
value associated with the duplicate key. Storing such a document will cause
19+
the other values to be lost.
20+
21+
{{% /note %}}
22+
1423
### BsonDocument
1524

1625
Although generally not needed by users of the high-level driver API, the [`BsonDocument`]({{< apiref "org/bson/BsonDocument" >}}) class is

0 commit comments

Comments
 (0)