GODRIVER-2765Backlog

Add an "omitzero" BSON struct tag

To support the use case of encoding Go structs as MongoDB documents, we will add an {{omitnil}} BSON struct tag that only omits {{nil}} values but includes empty values. The {{$push}} and {{$addToSet}} update operators work the same when modifying document fields that are empty arrays and document fields that do not exist (the only problem is document fields that are BSON null), so the behavior of {{omitnil}} maps well to that use case. Additionally, other MongoDB drivers (e.g. Java and Rust) of

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix

No fix available yet.

Components
Server components related to this issue
BSON
Labels
Tags and classification

No labels assigned.