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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Gone away
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: