skip to Main Content

Mongodb – When there are two objects inside an array in Mongoose, how can i populate them?

router.get('/mypage/myreport-comment', catchAsync( async(req, res) => { const { id } = req.user; const { page } = req.query; const totalPost = await Comment.find({'reports.user': id}).populate('reports.user'); //.countDocuments({}); let { startPage, endPage, hidePost, maxPost, totalPage, currentPage } = myPageCommentPaging(page, totalPost); const comments =…

VIEW QUESTION

Opening a new HTML file upon logging in

I can not get to the file success.html upon successfully logging in. Here's my client side code <!DOCTYPE html> <html> <head> <title>Login Page</title> <style> //CSS Styles </style> </head> <body> <div class="login-container"> <h2>Login</h2> <form id="loginForm" action="/login" method="POST"> <div> <label for="username">Username:</label> <input…

VIEW QUESTION
Back To Top
Search