mongodb に 2 つのテーブル構造があります。
> db.mapping.find()
{ "_id" : ObjectId("52d74f4941538c0b386090af"),
"tc" : DBRef("fttc", ObjectId("52d74f4841538c0b3860902e")),
"hit" : { "24" : 1, "25" : 1, "26" : 1, "27" : 2}}
...
> デシベル.fttc.find()
{ "_id" : ObjectId("52d74f4841538c0b38609041"),
"full" : "build1111_tastcase_20",
"tags" : [ "tag_0" ] }
...
> db.mapping.find()[0].tc.fetch().full
build1111_tastcase_1
> db.mapping.find({'tc.$id':ObjectId("52d74f4841538c0b3860902e")})
{ "_id" : ObjectId("52d74f4941538c0b386090a0"),
"tc" : DBRef("fttc", ObjectId("52d74f4841538c0b3860902e")),
"hit" : { "24" : 3, "25" : 3 } }
...
これで、tc の属性「id」がであるアイテムを取得できますObjectId("52d74f4841538c0b3860902e")
。
しかし、 tc の属性 ' full ' が ' build1111_tastcase_20 ' であるmappingからすべてのアイテムを見つけるにはどうすればよいでしょうか?
クエリステートメントはありますか?
どんな助けや提案も大歓迎です!