From bacbc5f093469027be55536fa7c4a446e3f1f705 Mon Sep 17 00:00:00 2001 From: Jordan Smith <45415425+jordan-smith721@users.noreply.github.com> Date: Wed, 3 Jan 2024 14:37:44 -0800 Subject: [PATCH] DOCSP-35287 Fix incorrect BSON option (#329) --- source/fundamentals/bson.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/fundamentals/bson.txt b/source/fundamentals/bson.txt index b2914a64..75a5253f 100644 --- a/source/fundamentals/bson.txt +++ b/source/fundamentals/bson.txt @@ -4,14 +4,19 @@ Work with BSON ============== -.. default-domain:: mongodb - .. contents:: On this page :local: :backlinks: none :depth: 2 :class: singlecol +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: code examples, serialization + Overview -------- @@ -219,7 +224,7 @@ This example performs the following actions: - Sets the ``UseJSONStructTags`` field to ``true``, which instructs the driver to use the ``"json"`` struct tag if a ``"bson"`` struct tag is not specified - - Sets the ``OmitZeroStruct`` field to ``true``, which instructs the driver + - Sets the ``NilSliceAsEmpty`` field to ``true``, which instructs the driver to marshal ``nil`` Go slices as empty BSON arrays - Passes the ``BSONOptions`` instance to the ``SetBSONOptions()`` helper method to specify @@ -230,7 +235,7 @@ This example performs the following actions: bsonOpts := &options.BSONOptions { UseJSONStructTags: true, - OmitZeroStruct: true, + NilSliceAsEmpty: true, } clientOpts := options.Client().