【发布时间】:2016-03-17 11:13:15
【问题描述】:
当我在控制台中写这个时,我得到了未定义的数据,但是数据在数据库中。我错过了什么?
Meteor.users.findOne({_id: this.userId},{fields: {"profile.pastEmployer.name": 1}});
【问题讨论】:
-
听起来该特定用户尚未发布。
-
我可以使用 meteortoys:allthings 看到它,所以我认为这意味着它已经发布了。
-
this.userId 指的是当前用户不是吗?
-
不,仅在推送器和方法中。否则你应该使用
Meteor.userId()。 -
这让我很头疼。我发布它只是为了确定,现在我得到了显示 userId 的对象,但不是我要求的信息
标签: meteor