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

collection scan for $exists is no longer allowed with --notablescan option

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • v1.3.3
    • manual
    • 4
    • true

    Description

      Setup: create a toy collection that has no indices:

      > t = db.t
      > t.drop()
      > t.save({a: 1})

      Then, start a 2.4.x mongod with the --notablescan option:

      > db.version()
      2.4.9
      > t.find({a: {$exists: true}}).explain()
      {
      	"cursor" : "BasicCursor",
           ...
      }

      Even though --notablescan was set, 2.4 is using a collection scan. This behavior has changed in 2.6:

      > db.version()
      2.6.0
      > t.find({a: {$exists: true}}).explain()
      Wed Apr  9 10:39:16.316 error: {
      	"$err" : "Unable to execute query: error processing query: ns=test.t limit=0 skip=0\nTree: a exists\nSort: {}\nProj: {}\n No query solutions",
      	"code" : 17007
      } at src/mongo/shell/query.js:128

      Although the 2.6 is definitely more logical, this is a backwards breaking change that surprised at least one user (see SERVER-13520). We should doc this so it doesn't bite more users!

      Attachments

        Issue Links

          Activity

            People

              kay.kim@mongodb.com Kay Kim (Inactive)
              david.storch@mongodb.com David Storch
              Jonathan Dahl Jonathan Dahl
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8 years, 12 weeks, 6 days ago