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

XMLWordPrintableJSON

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

      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 (Inactive)
              Reporter:
              Divjot Arora (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: