(async function() {
function S() {
return new Promise(resolve => {
for (var i = 0; i < result.items.length; i++) {
Mongo.Items.findOne({'_id': ObjectId(result.items[i])}, function(err3, result3) {
if (err3) console.log(err3);
if (result3) list.push(result3);
});
}
return resolve(list);
});
}
await S().then(function(res) {
console.log(res);
return response.send(res);
});
})();