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

$elemMatch not working as expected with $or

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • ALL
    • Hide

      Available in the Linked Ticket in the comments

      Show
      Available in the Linked Ticket in the comments

      Using the .NET/C# Driver, the following MQL (as seen in the linked ticket) does not work: 

      { Roles : { $elemMatch : { $or : [{ $eq : 1 }, { $eq : 2 }] } } } 

      Any suggestions for what the Driver should be doing instead?

      { Roles : { $in : [1, 2] } }

       will work for this specific case but we want to support it using LINQ (LINQ is a general purpose translator and the arguments to $or might not be $eq comparisons.)

            Assignee:
            Unassigned Unassigned
            Reporter:
            rishit.bhatia@mongodb.com Rishit Bhatia
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: