|
5ce04be64d3421479e69f8f53a097425c77cfe18.
> db.ta.save({_id:1, friends:[new DBRef("hi", 1), new DBRef("hey", 1)]})
|
Update WriteResult({
|
"ok" : 1,
|
"nDocsModified" : 0,
|
"n" : 1,
|
"upserted" : [
|
{
|
"index" : 0,
|
"_id" : 1
|
}
|
]
|
})
|
> db.ta.find({ friends: { $elemMatch: { $ref: "hi", $id:1 }}})
|
error: {
|
"$err" : "Can't canonicalize query: BadValue unknown top level operator: $ref",
|
"code" : 17287
|
}
|
> db.runCommand('buildInfo')
|
{
|
"version" : "2.5.5-pre-",
|
"gitVersion" : "5ce04be64d3421479e69f8f53a097425c77cfe18",
|
"OpenSSLVersion" : "",
|
"sysInfo" : "Linux build3.nj1.10gen.cc 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 BOOST_LIB_VERSION=1_49",
|
"loaderFlags" : "-static-libstdc++ -static-libgcc -fPIC -pthread -Wl,-z,now -rdynamic",
|
"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -fno-builtin-memcmp",
|
"allocator" : "tcmalloc",
|
"versionArray" : [
|
2,
|
5,
|
5,
|
-100
|
],
|
"javascriptEngine" : "V8",
|
"bits" : 64,
|
"debug" : false,
|
"maxBsonObjectSize" : 16777216,
|
"ok" : 1
|
}
|
|
|
What nightly was used? What git-hash?
I just tried this and it worked fine:
> db.ta.save({_id:1, friends:[new DBRef("hi", 1), new DBRef("hey", 1)]})
|
> db.ta.find({ friends: { $elemMatch: { $ref: "hi", $id:1 }}})
|
{ "_id" : 1, "friends" : [ DBRef("hi", 1), DBRef("hey", 1) ] }
|
|