import { connectDB } from '@/util/database';
import { ObjectId } from 'mongodb';
export default async function Detail(props) {
const db = (await connectDB).db("forum")
{/* 하나만 가져오기 : findOne */}
let res = await db.collection('post').findOne({ _id: new ObjectId("671f5c472a9f6567b42344c5")});
console.log(props);
return(
<div>
<h4>상세페이지</h4>
<h4>{res.title}</h4>
<p>{res.content}</p>
</div>
)
}
저는 props 출력해보면 이렇게 나와요

일단 꾸역꾸역 props.params.index 를 출력해보면 에러발생
await이 있는데 뭔지 이해가 잘 안갑니다
-
이 게시글은
유아린에 의해 8 월, 1 주 전에 수정됐습니다.
-
이 게시글은
유아린에 의해 8 월, 1 주 전에 수정됐습니다.