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

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

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v1.3.3
    • Component/s: manual
    • Last comment by Customer:
      true
    • Actual Time:
      4

      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

              Assignee:
              kay.kim Kay Kim (Inactive)
              Reporter:
              david.storch David Storch
              Participants:
              Last commenter:
              Jonathan Dahl Jonathan Dahl
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                7 years, 29 weeks, 4 days ago
                Date of 1st Reply: