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

bsoncore.Array not recognized as a valid type for aggregation pipelines

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Not Needed

      The transformAggregatePipeline function treats bsoncore.Array as a simple []byte and tries to marshal each value in the slice as a document, which fails. It should have a special case to recognize that bsoncore.Array actually represents a single BSON array. This gist repros the issue. Executing it fails with this error:

      cannot transform type uint8 to a BSON Document: WriteInt32 can only write while positioned on a Element or Value but is positioned on a TopLevel

            Assignee:
            benji.rewis@mongodb.com Benji Rewis (Inactive)
            Reporter:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: