【问题标题】:Meteor listing all users in Meteor.usersMeteor 列出 Meteor.users 中的所有用户
【发布时间】:2015-01-13 03:08:36
【问题描述】:

我正在尝试管理 Meteor.users 集合中保存的 Meteor 应用程序用户数据(角色、个人资料数据...等),但似乎无法找到如何列出所有可用用户帐户(他们的 ID、电子邮件...等)以用户身份登录时,所以我想知道是否有人可以通过告诉我该怎么做来帮助我?任何示例都将受到高度赞赏。

我试过使用 Meteor.users.find(), Meteor.users.find({}, {fields: {emails: 1, profile: 1}});但即使我的应用中已经定义了 3 个用户,也没有运气。

【问题讨论】:

    标签: meteor


    【解决方案1】:

    Meteor.users.find() 返回所有用户,你还记得发布/订阅这个集合吗?

    【讨论】:

    • 自动发布仍处于启用状态,因此不必进行任何发布/订阅。试过 Meteor.users.find() 但没有返回数据
    • 必须的,试试 console.log(Meteor.users.find().fetch());
    • 非常感谢,不胜感激 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-22
    • 1970-01-01
    相关资源
    最近更新 更多