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

Aggregate should not accept bson.D as a pipeline

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.7.2
    • None
    • None
    • None
    • Not Needed

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: