본 포스팅은 스터디를 통해 작성한 글을 복사한 내용입니다. 여기서 더 많은 글들을 확인하실 수 있습니다. 예제에서 사용될 컬렉션은 다음과 같습니다. 사용자 : users export const UserScheme = new Schema({ _id: { type: ObjectId }, userName: { type: String }, roleCode: { type: String }, createDate: { type: Date, default: Date.now }, }); 역할 : roles export const RoleScheme = new Schema({ _id: { type: ObjectId }, roleName: { type: String }, }); INSERT 먼저 roles 컬렉션에 데이터를..
Node와 MongoDB(+Mongoose)
2024. 2. 27.