내가 지금은 내 질문에 두 가지 문제가 실현 부울 값으로 쿼리의 결과를 제외합니다.
1 (내 원래의 질문) : 노드/익스프레스에서
나는 부울 값에 의해 몽고 쿼리의 결과를 필터링하기 위해 노력하고있어. 충분히 간단해야합니까? 기본적으로 프로필이 완료되지 않은 경우 사용자를 무시하고 싶습니다. 중 내가 $nin
에 대한 $ne
을 교환하려고했습니다
{profileComplete: {$ne: false}}
하지만,이 does't 일 :
이 공을 재생되지 않는 쿼리의 특정 부분입니다.
내가 그 쿼리에 문제가 있습니까?
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를 파악하고 있었지만 바로 그 때였습니다.