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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.6.3
    • Internal Code
    • None
    • ALL

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: