-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
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 }
-
Major Change
-
ALL
{$gt: [X]} matches arrays in 2.4.8 but not in 2.5.3. This is a change in the matcher behavior when the operand to the inequality operator is an array.
In 2.4.8, the matching behavior is affected by the level of nesting of the array.
In 2.5.3, the matcher returns zero documents as long as the element in the collection is an array.
--------------------
Problem:
A two level nested array produces different results in 2.5.4
NOTE: It appears that 2.5.4-Pre deals with this case correctly, if confirmed then this becomes a DOC tickets to list the changed behaviour.
Reproduce:
db.q.drop() db.q.insert({"c" : { "c" : [ [ [ [ ISODate("1383-05-28T00:00:00Z") ] ] ] ] }}) db.q.insert({"c" : { "c" : [ [ [ ISODate("1383-05-28T00:00:00Z") ] ] ] }}) db.q.insert({"c" : { "c" : [ [ ISODate("1383-05-28T00:00:00Z") ] ] }}) db.q.insert({"c" : { "c" : [ ISODate("1383-05-28T00:00:00Z") ] }}) db.q.find( { $nor : [ { "c.c" : { $gt : [ [ ISODate("2013-09-29T10:40Z") ] ] } } ] } )
2.4.5
Returns 3 documents, but not the [ [ value ] ]
{ "_id" : ObjectId("526fdf7c8a43120c67c8c575"), "c" : { "c" : [ [ [ [ ISODate("1383-05-28T00:00:00Z") ] ] ] ] } } { "_id" : ObjectId("526fdf7c8a43120c67c8c576"), "c" : { "c" : [ [ [ ISODate("1383-05-28T00:00:00Z") ] ] ] } } { "_id" : ObjectId("526fdf7c8a43120c67c8c578"), "c" : { "c" : [ ISODate("1383-05-28T00:00:00Z") ] } }
2.5.4-Pre returns all documents
{ "_id" : ObjectId("526fdf886ca3a8357d0fe402"), "c" : { "c" : [ [ [ [ ISODate("1383-05-28T00:00:00Z") ] ] ] ] } } { "_id" : ObjectId("526fdf886ca3a8357d0fe403"), "c" : { "c" : [ [ [ ISODate("1383-05-28T00:00:00Z") ] ] ] } } { "_id" : ObjectId("526fdf886ca3a8357d0fe404"), "c" : { "c" : [ [ ISODate("1383-05-28T00:00:00Z") ] ] } } { "_id" : ObjectId("526fdf886ca3a8357d0fe405"), "c" : { "c" : [ ISODate("1383-05-28T00:00:00Z") ] } }
It appears that 2.4.x does not deal with the [ [ value ] ] case correctly.
- duplicates
-
SERVER-11402 $gte/$gt behave differently when comparing arrays of booleans
- Closed
-
SERVER-11403 $lt/$lte operator behaves differently when a string comparison is made against a (nested) array of numbers
- Closed
-
SERVER-11404 $nor operator behaves differently when comparing arrays of dates
- Closed
-
SERVER-11405 $gt/$gte behavior change when comparing arrays of numbers
- Closed
-
SERVER-11406 Change in behavior on how $gte work with an array as a parameter
- Closed
-
SERVER-11377 $gte doesn't match whole arrays but equality does
- Closed
- is duplicated by
-
SERVER-12471 $all with array objects, differs in 2.4 and 2.5
- Closed
- related to
-
SERVER-26655 $gt operation on array with index
- Closed