0
我现在意识到我有两个问题,我的查询。
1(我原来的问题):
在节点/快递我试图通过一个布尔值过滤从Mongo的查询结果。应该很简单吧?基本上,如果配置文件不完整,我想忽略用户。
这是一个不打球查询的特定部分:
{profileComplete: {$ne: false}}
我试过换$ne
为$nin
,但这种简化版,工作要么。
难道我得到的东西错在该查询?
这里就是整个查询的情况下,这是有用的:
req.session.query = {$and:
[
{learningLanguages: {$in: req.user.spokenLanguages}}, // matches other users' learning languages with the current users spoken language(s)
{_id: {$nin: [req.user.blockedUsers.split(","), req.user._id]}}, // disregard users who have been blocked by the current user AND the current user him/herself
{profileComplete: {$ne: false}} // disregard users who haven't completed their profiles yet.
]
}
2:
我也刚刚发现,阻断自己的登录用户从结果不工作要么。这是该行查询的最后一位:{_id: {$nin: [req.user.blockedUsers.split(","), req.user._id]}}
正当我虽然我正在认真处理的MongoDB。