Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2031

$nor indicates there needs to be 2 or more expressions - that's incorrect

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 01112017-cleanup
    • mongodb-2.6
    • manual

    Description

      Problem:

      The documentation for 2.4.6 states

      $nor performs a logical NOR operation on an array of two or more <expressions> and selects the documents that fail all the <expressions> in the array.

      In fact this is not the case, a $nor works with a single element.

      Reproduce:

      db.foo.drop()
      db.foo.insert({a:1})
      db.foo.insert({a:2})
      db.foo.find({$nor:[{a:1}]})
      { "_id" : ObjectId("524df09df43a2f3063bee9d7"), "a" : 2 }

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            alvin Alvin Richards (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 19 weeks, 5 days ago