Skip to content
Merged
Changes from 3 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
3 changes: 3 additions & 0 deletions source/fundamentals/bson.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ This example performs the following actions:
to use the ``"json"`` struct tag if a ``"bson"`` struct tag is not specified
- Sets the ``NilSliceAsEmpty`` field to ``true``, which instructs the driver
to marshal ``nil`` Go slices as empty BSON arrays
- Sets the ``OmitEmpty`` field to ``true``, which instructs the driver to globally omit
empty values from the marshaled BSON, rather than set empty values to ``null``

- Passes the ``BSONOptions`` instance to the ``SetBSONOptions()`` helper method to specify
a ``ClientOptions`` instance
Expand All @@ -236,6 +238,7 @@ This example performs the following actions:
bsonOpts := &options.BSONOptions {
UseJSONStructTags: true,
NilSliceAsEmpty: true,
OmitEmpty: true,
}

clientOpts := options.Client().
Expand Down