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

Missing operator to compare two fields in aggregation framework query

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None

      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.

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

              Created:
              Updated:
              Resolved: