[SERVER-11737] $not unable to be chained in 2.4 version Created: 15/Nov/13  Updated: 10/Dec/14  Resolved: 23/Dec/13

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.4.9
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Luke Lovett Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: 26qa, nqf
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

> db.serverBuildInfo()
{
"version" : "2.4.9-pre-",
"gitVersion" : "5779b6e198c0dd22a99e12837faea4b5e8b2664f",
"sysInfo" : "Darwin bs-osx-106-x86-64-2.10gen.cc 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
"loaderFlags" : "-fPIC -pthread -rdynamic -m64",
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O3 -m64",
"allocator" : "system",
"versionArray" : [
2,
4,
9,
-100
],
"javascriptEngine" : "V8",
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}

and

> db.serverBuildInfo()
{
"version" : "2.5.4-pre-",
"gitVersion" : "cf0103d736d93d14f1b3eaa7fe3e97a2c77a8080",
"OpenSSLVersion" : "",
"sysInfo" : "Darwin bs-osx-106-x86-64-2.10gen.cc 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
"loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -m64 -mmacosx-version-min=10.6",
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -O3 -m64 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
"allocator" : "system",
"versionArray" : [
2,
5,
4,
-100
],
"javascriptEngine" : "V8",
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}


Issue Links:
Related
Operating System: ALL
Steps To Reproduce:

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 }

Participants:

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


Generated at Thu Feb 08 03:26:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.