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 数组中的州和国家/地区找到除我自己以外的所有用户。这可能与填充?