하루 종일 개삽질하다가 공유합니다.
거두절미하고,
MongooseModule.forRootAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => ({
uri: configService.get("DB_URL"),
auth: {
user: configService.get("DB_USERNAME"),
password: configService.get("DB_PASSWORD"),
},
authSource : "admin"
}),
inject: [ConfigService],
}),
보통 이런식으로 많이들 하실텐데요,
authSource : "admin"
이걸 집어넣자마자 바로 해결됐습니다.
이거 때문에 하루종일 몽고 재설치하고, 권한부여하고 난리를 쳤는데 허허,,
ps) authSource 가 뭐길래?
=> 몽고DB의 사용자 정보를 담아놓는 데이터베이스라고 합니다. 평소에 mongodb 를 안쓰다가 썼더니 이런 간단한걸 너무 돌아간 거 같네요.
'Back-End > NestJS' 카테고리의 다른 글
NestJS(Node.js) 프레임워크로 SMS 문자 인증 서버 구현하기 (Naver Cloud Platform SENS API ) (0) | 2021.03.01 |
---|
최근댓글