gpt4 book ai didi

meteor - meteor.js:通过电子邮件查找用户

转载 作者:行者123 更新时间:2023-12-03 12:00:15 25 4
gpt4 key购买 nike

在我的meteor.js应用程序中,我试图编写一个简单的管理页面,该页面可以通过用户的电子邮件地址查找该用户。

我可以看到,在Meteor.users集合中有一个“电子邮件”数组,其中包含类似这样的对象

{ address : 'foo@foo.com',
verified : false
}

通常,在Mongodb中,我可以像下面这样在“电子邮件”数组中进行搜索:
Meteor.users.find({ emails.address : 'foo@foo.com' });

但是这个查询抛出一个错误:
While building the application:
client/admin.js:224:41: Unexpected token .

Aka Meteor不喜欢嵌套查询...

关于如何通过电子邮件地址查询Meteor.users集合的任何想法?

最佳答案

如果在服务器上,Meteor为此具有特殊功能:
Accounts.findUserByEmail(email)

我相信这是推荐的方法。

关于meteor - meteor.js:通过电子邮件查找用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19695437/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com