Skip to content

Commit 44a017f

Browse files
DOCSP-35287 Fix incorrect BSON option (#329)
(cherry picked from commit bacbc5f)
1 parent d3f3855 commit 44a017f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

source/fundamentals/bson.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
Work with BSON
55
==============
66

7-
.. default-domain:: mongodb
8-
97
.. contents:: On this page
108
:local:
119
:backlinks: none
1210
:depth: 2
1311
:class: singlecol
1412

13+
.. facet::
14+
:name: genre
15+
:values: reference
16+
17+
.. meta::
18+
:keywords: code examples, serialization
19+
1520
Overview
1621
--------
1722

@@ -219,7 +224,7 @@ This example performs the following actions:
219224

220225
- Sets the ``UseJSONStructTags`` field to ``true``, which instructs the driver
221226
to use the ``"json"`` struct tag if a ``"bson"`` struct tag is not specified
222-
- Sets the ``OmitZeroStruct`` field to ``true``, which instructs the driver
227+
- Sets the ``NilSliceAsEmpty`` field to ``true``, which instructs the driver
223228
to marshal ``nil`` Go slices as empty BSON arrays
224229

225230
- Passes the ``BSONOptions`` instance to the ``SetBSONOptions()`` helper method to specify
@@ -230,7 +235,7 @@ This example performs the following actions:
230235

231236
bsonOpts := &options.BSONOptions {
232237
UseJSONStructTags: true,
233-
OmitZeroStruct: true,
238+
NilSliceAsEmpty: true,
234239
}
235240

236241
clientOpts := options.Client().

0 commit comments

Comments
 (0)