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

$not unable to be chained in 2.4 version

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 2.4.9
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
    • Environment:
    • Operating System:
      ALL
    • Steps To Reproduce:
      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 }

      Description

      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).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              luke.lovett Luke Lovett
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: