我正在获取用户数据,然后获取用户计划,然后将它们进行比较以显示用户明智的计划列表。
if data.user_list[0]
each user_list,i in data.user_list[0]
tr
td.center img(src='admin/img/details_open.png')
td #{user_list.first_name} #{user_list.last_name}
td #{user_list.email}
td.hidden-phone #{user_list.occupation}
td.center.hidden-phone #{user_list.city}
td.center.hidden-phone #{user_list.medical_condition}
if data.user_plan_list
each user_plan,j in data.user_plan_list
if (user_plan.member_id===user_list._id)
| in if #{user_plan.member_id} "---" #{user_list._id}
br
else
| in else #{user_plan.member_id} "---" #{user_list._id}
br
答案 0 :(得分:0)
添加了toString()函数,将对象类型转换为字符串进行比较
if data.user_plan_list
-var count=1;
each user_plan,i in data.user_plan_list
if user_plan.member_id.toString() == user_list._id.toString()