[GODRIVER-2786] "bson.MarshalValue" does not support "any" value of "nil" Created: 29/Mar/23  Updated: 26/Jul/23

Status: Backlog
Project: Go Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Matt Dale Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to GODRIVER-2765 Add an "omitnil" BSON struct tag Backlog

 Description   

The MarshalValue function returns an error if you try to marshal a value like var v any = nil, despite the same value marshaling correctly to BSON "null" when using Marshal.

Check out an example using MarshalValue here. Check out an example using Marshal here.

Definition of done:

  • Calling bson.MarshalValue(nil) returns type "bsontype.Null", an encoded BSON "null" value, and no error.

Generated at Thu Feb 08 08:39:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.