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。