Consider allowing $elemMatch applied to non arrays

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently $elemMatch can only be applied to an array. For example { a:{ $elemMatch:{ $gte:1, $lte:10 } } } will match { a:[ 5 ] } but not { a:5 }. This is a bit awkward in a case like { 'a.b':{ $elemMatch:{ $gte:1, $lte:10 } } } and a document { a:[ { b:5 }, { b:15 } ] }. The document will not match because the b values are not arrays, even though there could be multiple values of 'a.b'.

              Assignee:
              David Storch
              Reporter:
              Aaron Staple (Inactive)
              Votes:
              16 Vote for this issue
              Watchers:
              22 Start watching this issue

                Created:
                Updated:
                Resolved: