Missing operator to compare two fields in aggregation framework query

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • 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
            Reporter:
            Joe Davis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: