var UserSchema = Schema (
{
android_id: String,
rooms: [{ type: Schema.Types.ObjectId, ref: 'Chatrooms'}],
location: {country: String, state: String, coordinates: { latitude: String, longitude: String}}
});
var RoomSchema = Schema
({
Roomname: {type: String},
ids: {type: Array},
});
Users
.find({android_id: {$ne: userID}, 'location.state': LocationArray.state, 'location.country': LocationArray.country})
.populate({
path: 'rooms',
match: {'rooms.ids': {$nin: [userID]}},
select: 'ids'
})
.exec(function(err, found) {
})
나는 그들과 함께 ids 배열에 있지 않은 주와 국가에서 나를 제외한 모든 사용자를 찾고 싶습니다. 채우기로 가능합니까?
이것이 당신을 도울 수 있기를 바랍니다.
Users
.find({android_id: {$ne: userID}, 'location.state': LocationArray.state, 'location.country': LocationArray.country})
.populate({
path: 'rooms',
match: {'ids': {$nin: [userID]}},
select: 'ids'
})
.exec(function(err, found) {
if(found){
vettings = found.filter(function (doc) {
return doc.ids;
});
}
})
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다