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

$and Query and "Implicit $and" queries are not consistent

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.3
    • Component/s: Internal Code
    • Labels:
      None
    • ALL

      I found a very strange behaviour with mongodb 3.6.3, running on Linux Centos 6.0

      I always thought that those two queries:

      {
         "a": 1,
         "b": 2
      }
      

      and

      {
         $and:[
         {"a":1},
         {"b":2}
      ]
      }
      

      were equivalent, but with the latest version (3.6.3) the results are completely different!

      Look at the two screenshots attached, the underlying collection is the same but the only correct result is the one with "$and" clause. In the example "births" can be a String or a Number.

      I ran the same query also within the mongoshell with the same inconsistent bug.

      Please fix it as soon as possible.

            Assignee:
            ramon.fernandez@mongodb.com Ramon Fernandez Marina
            Reporter:
            Gammieri Vincenzo [X]
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: