const users = await query('users');
const meetings = await query('meetings');
const response = meetings.collection.find({members: { $in: [res.locals['user'].id]}}).toArray();
const result = response.map(meeting => {
const members = meeting['members'].map((member_id: string) => {
return users.collection.findOne({id: member_id});
});
return {
...meeting,
members
}
});
console.log(result);
res.send({
message: result
});
});