Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7621

Missing operator to compare two fields in aggregation framework query

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Aggregation Framework
    • None

    Description

      There doesn't seem to be a way to include a $match condition that compares two fields eg to include all documents where field1 == field2:

      { "$match" : { "$field1" : { "$eq" : "$field2"}} }

      We can only use operators that compare a field against values.

      $where is no longer allowed in aggregate framework queries, so one cannot use arbitrary javascript to achieve this.

      Attachments

        Activity

          People

            Unassigned Unassigned
            joe.davis@servicenow.com Joe Davis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: