router
.get('/user', async(ctx) => {
auth(ctx);
try {
let orders = await Order.find((err, doc) => {
return doc;
});
return ctx.render('user', {
title: 'Главнвя страница',
username: ctx.state.user,
order: orders
});
} catch(err){
await console.log(err);
}
});
Order.find().lean().then ...