File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 44Work 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+
1520Overview
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().
You can’t perform that action at this time.
0 commit comments