Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-971

ability to marshal empty slices as bson [] rather than nil

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      If a field in a struct is a slice, and it has no elements, and it is not omit empty, then it’s BSON value is nil.

      This means that you can’t treat it like an array (e.g. use $push,) and we ran into issues with $in as well.

      In MGO these types were [], and it appears that our application depends on this.

            Assignee:
            Unassigned Unassigned
            Reporter:
            sam.kleinman Sam Kleinman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: