해당 과정에서 에러가 해결되지 않고 있습니다 ㅠㅠ
구글링도 해보고 여러 시도도 해봤지만..뭐가 문제인지 도저히 모르겠습니다.... 도와주세요 ㅠㅠ
server.js 코드
app.get('/list',(req,res)=>{
db.collection('post').find().toArray(function(err, res){
console.log(res);
console.log(err);
res.render('list.ejs', { posts : res});
});
list.ejs 코드
<h4>할일 제목 : <%= posts[0].제목 %></h4>
<p>할일 마감날짜 : <%= posts[0].날짜 %></p>
render쪽 코드를 ejs를 기입하며 function에 짚어넣기 전에는 localhost에 잘 표출 됩니다.
render쪽 코드에 ejs 를 쓰고 function 안쪽으로 넣으면 아래 err 코드가 뜨고.. 작동이 되지 않습니다. ㅠㅠ 도와주세요...
아래 에러가 계속 표출됩니다..
(node:5448) Warning: Accessing non-existent property 'MongoError' of module exports inside circular dependency
(Use node --trace-warnings ...
to show where the warning was created)
(node:5448) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
listening on 8080