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

Aggregate should not accept bson.D as a pipeline

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

      Aggregate() functions currently accept bson.D as a valid value for the pipeline parameter but should not allow this because a bson.D is semantically a single document while a pipeline is an array of documents. This likely works internally because bson.D is implemented as a slice of bson.E, so it passes our "value is a slice" check in transformAggregatePipeline. We may have to special case bson.D and possibly other slice-based types like bson.Raw to prevent this. A reproducible example of this issue is here.

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

              Created:
              Updated:
              Resolved: