Fix serialization of nested $elemMatch's

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.1.0-rc0, 7.0.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • v7.0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      After serialization with "LiteralSerializationPolicy::kToRepresentativeParseableValue", $elemMatch fails to re-parse with the error (with $gte or equivalent operators)

      unknown top level operator: $gte 

      It seems like this may be the case because multiple $elemMatch predicates for one field are dispatched with the syntax 

      { a : { $elemMatch :{$elemMatch:{ b: { $gte: 1, $lte: 1 } } } } }

      but are serialized to 

      { a: { $elemMatch: { $elemMatch: { $and: [ { $lt: 1 }, { $gt: 1 } ] } } } } 

       It seems the $and syntax may be causing re-parseability issues.

       

      You can see the relevant failing tests in the query_stats_passthrough in BF-29272 and BF-29276

              Assignee:
              Will Buerger
              Reporter:
              Will Buerger
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: