-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.4.5
-
Component/s: Querying
-
Environment:> db.serverBuildInfo()
{
"version" : "2.5.4-pre-",
"gitVersion" : "d8ca8b5faa1447365403cfb8da16a041e7d31d95",
"OpenSSLVersion" : "",
"sysInfo" : "Darwin vero 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
"loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6",
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
"allocator" : "tcmalloc",
"versionArray" : [
2,
5,
4,
-100
],
"javascriptEngine" : "V8",
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}
> db.serverBuildInfo() { "version" : "2.5.4-pre-", "gitVersion" : "d8ca8b5faa1447365403cfb8da16a041e7d31d95", "OpenSSLVersion" : "", "sysInfo" : "Darwin vero 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49", "loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load -mmacosx-version-min=10.6", "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6", "allocator" : "tcmalloc", "versionArray" : [ 2, 5, 4, -100 ], "javascriptEngine" : "V8", "bits" : 64, "debug" : false, "maxBsonObjectSize" : 16777216, "ok" : 1 }
-
ALL
Problem:
Appears to be a change in behavior between 2.4.5 and 2.5.4-Pre how $lte and $lt evaluate arrays of numbers.
NOTE: The behavior in 2.5.4-Pre seems to be correct, ticket is to confirm that.
Reproduce:
db.q.drop(); db.q.insert({"d" : [ [ 314159265008, [ 314159265014 ] ] ], "a" : { "b" : { "d" : ISODate("2013-09-29T00:00:00Z") } } }) db.q.find( { "d" : { $lt : [ "Before I got married I had six theories about bringing up children; now I have six children and no theories." ] } } ).itcount() db.q.find( { "d" : { $lte : [ "Before I got married I had six theories about bringing up children; now I have six children and no theories." ] } } ).itcount()
2.4.5: 1 document returned per query
2.5.4-Pre: Zero documents
Note:
These queries produce the same results on both 2.4.5 and 2.5.4-Pre (zero documents)
db.q.find( { "d" : { $gt : [ "Before I got married I had six theories about bringing up children; now I have six children and no theories." ] } } ).itcount() db.q.find( { "d" : { $gte : [ "Before I got married I had six theories about bringing up children; now I have six children and no theories." ] } } ).itcount()
- is duplicated by
-
SERVER-11444 $lt/$lte/$gte/$gt behaves differently with array operand
- Closed