-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.5.3
-
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 }
-
Minor Change
-
ALL
Problem:
$exists appears to match arrays in a dotted expression differently between versions.
Reproduce:
db.q.drop() db.q.insert({ "a" : [ { "0" : { "2" : { "b" : "To the man who only has a hammer, everything he encounters begins to look like a nail." } } } ] }) db.q.insert({ "a" : [ { "0" : { "2" : { "b" : 99 } } } ] }) db.q.insert({ "a" : [ { "0" : { "2" : 42 } } ] }) db.q.insert({ "a" : { "0" : { "x" : 42 } } }) db.q.find( { "a.0.2" : { $exists : 0 } } )
2.4.5 returns
{ "_id" : ObjectId("527068948a43120c67c8c621"), "a" : [ { "0" : { "2" : { "b" : "To the man who only has a hammer, everything he encounters begins to look like a nail." } } } ] } { "_id" : ObjectId("527068948a43120c67c8c622"), "a" : [ { "0" : { "2" : { "b" : 99 } } } ] } { "_id" : ObjectId("527068948a43120c67c8c623"), "a" : [ { "0" : { "2" : 42 } } ] } { "_id" : ObjectId("527068948a43120c67c8c624"), "a" : { "0" : { "x" : 42 } } }
2.5.4-Pre returns
{ "_id" : ObjectId("527068b76ca3a8357d0fe436"), "a" : { "0" : { "x" : 42 } } }