[DOCS-3098] collection scan for $exists is no longer allowed with --notablescan option Created: 09/Apr/14  Updated: 09/Apr/14  Resolved: 09/Apr/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.3

Type: Task Priority: Minor - P4
Reporter: David Storch Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: sprint-slipstream
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-13520 The $exists operator fails if the fie... Closed
Participants:
Days since reply: 9 years, 45 weeks ago

 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!



 Comments   
Comment by Githook User [ 09/Apr/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-3098 exists and notablescan
Branch: master
https://github.com/mongodb/docs/commit/c2bab425c4daf61a6f6f4b48c891bbc14b928374

Generated at Thu Feb 08 07:44:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.