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

Struct decoder only works for lowercased fields

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.1.1
    • Affects Version/s: None
    • Component/s: BSON

      If no struct tags are provided, the struct decoder will only work if the lowercased struct field name matches the BSON key. This doesn't work for camel-cased fields.

      For example, if the BSON key is "firstBatch", the struct decoder will not find it in the struct because it is looking for "firstbatch".

      Filing this as a question ticket because I'm not sure what we want the behavior to be. At the very least, we should document this behavior and encourage users to always use struct tags.

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: