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

$expr should fail to parse if there are extra fields

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Gone away
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Querying
    • None
    • Query
    • ALL

    Description

      Currently, when we are parsing a match expression, if we are in a position where there can be a $expr object, we will parse an object as a $expr if it contains exactly one field called $expr. Otherwise, it is treated as a literal object. However, this could cause an issue in the future if we add an additional option to $expr, say $option. Then in 3.6, we would parse {a: {$gt: {$expr: 5, $option: true}}} as comparison to the literal object {$expr: 5, $option: true}, but in 3.x, this would be treated as $expr with an option. Instead, in 3.6, we should fail to parse a $expr that has more than one field.

      Attachments

        Activity

          People

            backlog-server-query Backlog - Query Team (Inactive)
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: