Aggregate should not accept bson.D as a pipeline

XMLWordPrintableJSON

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

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

                Created:
                Updated:
                Resolved: