const result = response.map(meeting => {
const members: any[] = [];
meeting['members'].forEach((user_id: string, i: number) => {
query('users').then(data => {
const user = data.collection.findOne({id: user_id});
members.push(user);
}).catch(console.error);
});
return {
...meeting,
members
}
});
async getUsers() {
const users = await query('users');
const members = meeting['members'].map((user_id) => users.collection.findOne({id: user_id}));
return [...meetings, members]
}