Mongodb – Mongoose: Using aggregate to filter based on Model.field_1.field_2 doesn't work
I have this function: const getNotificationsForLounge = async (lounge_id) => { try { const notifications = await Notification.aggregate([ { $match: { "lounge_join_request.lounge": lounge_id, lounge_join_request: { $ne: null }, }, }, ]); console.log("🚀 ~ notifications:", notifications); // Do something with the…