【发布时间】:2016-03-17 13:52:13
【问题描述】:
我正在研究角度流星。 在我的数据库中有两个集合,即订阅和学校。 订阅:
[
{
"_id" : "9qAcc86yhG7hSxejL",
"school" : {
"_id" : "uz7rMGXJwn566GhBg"
},
"wrk_status":"completed"
},
{
"_id" : "9qAcc86yhG7hSxejL",
"school" : {
"_id" : "uz7oMGXJwn566GhBg"
},
"wrk_status":"pending"
},
{
"_id" : "9qAcc86yhG7hSxejL",
"school" : {
"_id" : "uz7pMGXJwn566GhBg"
},
"wrk_status":"completed"
}]
学校:
[
{
"_id" : "uz7rMGXJwn566GhBg",
"name" : "The Oxford School",
"address" : "Trivandrum",
"status" : "new",
},
{
"_id" : "uz7oMGXJwn566GhBg",
"name" : "The School",
"address" : "Trivandrum",
"status" : "new",
},
{
"_id" : "uz7pMGXJwn566GhBg",
"name" : "The new School",
"address" : "Trivandrum",
"status" : "new",
}]
所以我想从订阅集合中的 wrk_status 完成的学校集合中获取学校的名称、地址和状态。 所以一开始我想订阅订阅集合并获取wrk_status完成的学校._id,然后订阅学校集合以列出具有该学校的学校的详细信息._id
【问题讨论】:
-
您可能会后悔为集合命名subcriptions...
标签: angularjs meteor angular-meteor