【发布时间】:2017-03-22 15:10:47
【问题描述】:
在运行 Meteor 的网站上。通过 Google chrome 控制台我可以运行:
Meteor.user()
这将返回我登录帐户所需的内容。
当我跑步时
Meteor.users()
返回
VM596:1 Uncaught TypeError: Meteor.users is not a function
有人可以建议吗?
【问题讨论】:
在运行 Meteor 的网站上。通过 Google chrome 控制台我可以运行:
Meteor.user()
这将返回我登录帐户所需的内容。
当我跑步时
Meteor.users()
返回
VM596:1 Uncaught TypeError: Meteor.users is not a function
有人可以建议吗?
【问题讨论】:
Meteor.users 是一个包含所有用户文档的 mongo 集合。所以你不能做 Meteor.users()。相反,您可以使用
在其中找到文档Meteor.users.find({}).fetch();
更多信息可以看meteor docs
【讨论】:
您必须在 package.js 中包含以下包才能让 Meteor.users 运行
accounts-password@1.3.3
【讨论】: