You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/content/bson/documents.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ the other values to be lost.
22
22
23
23
### BsonDocument
24
24
25
-
Although generally not needed by users of the high-level driver API, the [`BsonDocument`]({{< apiref "org/bson/BsonDocument" >}}) class is
25
+
Although generally not needed by users of the high-level driver API, the [`BsonDocument`]({{< apiref "bson" "org/bson/BsonDocument" >}}) class is
26
26
central to the way that documents are managed internally by the driver. The `BsonDocument` class can represent dynamically structured
27
27
documents of any complexity with a type-safe API. For instance, the document
28
28
@@ -42,11 +42,11 @@ new BsonDocument().append("a", new BsonString("MongoDB"))
42
42
43
43
The type safety comes from `BsonDocument` implementing `Map<String, BsonValue>`, so even built-in types like `int`, `String` and `List` must
44
44
be wrapped in a sub-class of `BsonValue`. For a complete list of `BsonValue` sub-types, please consult the
45
-
[`BsonValue`]({{< apiref "org/bson/BsonValue" >}}) API documentation.
45
+
[`BsonValue`]({{< apiref "bson" "org/bson/BsonValue" >}}) API documentation.
46
46
47
47
### Document
48
48
49
-
Most applications will use the [`Document`]({{< apiref "org/bson/Document" >}}) class instead. Like `BsonDocument`, the
49
+
Most applications will use the [`Document`]({{< apiref "bson" "org/bson/Document" >}}) class instead. Like `BsonDocument`, the
50
50
`Document` class can represent dynamically structured documents of any complexity; however, the typing is much looser, as `Document`
51
51
implements `Map<String, Object>`. As a result, the same document as above can be constructed using the Document class as follows:
52
52
@@ -79,17 +79,17 @@ reference .
79
79
### DBObject
80
80
81
81
Although not recommended for new applications, those upgrading from the 2.x driver series may continue to use the
82
-
[`DBObject`]({{< apiref "com/mongodb/DBObject" >}}) interface to represent BSON documents. `DBObject` is similar to Document in that it
82
+
[`DBObject`]({{< apiref "mongodb-driver-core" "com/mongodb/DBObject" >}}) interface to represent BSON documents. `DBObject` is similar to Document in that it
83
83
represents BSON values as `Object`, but it has a few shortcomings that were impossible to overcome:
84
84
85
85
- it is an interface rather than a class, so it's API can not be extended without breaking binary compatibility
86
86
- it doesn't actually implement `Map<String, Object>`
87
-
- because it is an interface, a separate concrete class called [`BasicDBObject`]({{< apiref "com/mongodb/BasicDBObject" >}}) which
87
+
- because it is an interface, a separate concrete class called [`BasicDBObject`]({{< apiref "mongodb-driver-core" "com/mongodb/BasicDBObject" >}}) which
88
88
implements that interface, is required
89
89
90
90
### Bson
91
91
92
-
To tie these all together, the driver contains a small but powerful interface called [`Bson`]({{< apiref "org/bson/conversions/Bson" >}}).
92
+
To tie these all together, the driver contains a small but powerful interface called [`Bson`]({{< apiref "bson" "org/bson/conversions/Bson" >}}).
93
93
Any class that represents a BSON document, whether included in the driver itself or from a third party, can implement this interface and
94
94
can then be used any place in the high-level API where a BSON document is required. The three classes discussed above all implement this
95
95
interface and so can be used interchangeably based on the needs of a given application. For example:
0 commit comments