$not unable to be chained in 2.4 version

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.4.9
    • Component/s: Querying
    • Environment:
    • ALL
    • Hide

      2.4.9-pre-

      > db.c.insert({b:0})
      > db.c.find({b:{$not:{$not:{$gt:-1000}}}})
      error: { "$err" : "invalid use of $not", "code" : 13034 }
      

      2.5.4-pre-

      > db.c.insert({b:0})
      > db.c.find({b:{$not:{$not:{$gt:-1000}}}})
      { "_id" : ObjectId("5286a1a522d7b1bbbfb7813a"), "b" : 0 }
      
      Show
      2.4.9-pre- > db.c.insert({b:0}) > db.c.find({b:{$not:{$not:{$gt:-1000}}}}) error: { "$err" : "invalid use of $not" , "code" : 13034 } 2.5.4-pre- > db.c.insert({b:0}) > db.c.find({b:{$not:{$not:{$gt:-1000}}}}) { "_id" : ObjectId( "5286a1a522d7b1bbbfb7813a" ), "b" : 0 }
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Query behavior discrepancy: $not operators are able to be chained together in 2.5.x, but this isn't possible in 2.4. Intuitively, it seems that the 2.5.x behavior is correct and that either 2.4 should be fixed or there should be some docs explaining the new behavior (and this ticket can be moved to DOCS).

            Assignee:
            Unassigned
            Reporter:
            Luke Lovett (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: