Duplicated Index error

2020. 6. 25. 01:05Development/MongoDB

 

MongoDB에서 가끔 해당 오류가 날 때가 있다. null 키가 중복된다면서 뜨는 오류인데, 중복을 허용하지 않을 때 null 값을 두개이상 기록하려고 하면 null이 두개라서 중복된다....

 

 

공식문서를 참고하여 아래 명령어만 쿼리하면 된다.

 

Collection.dropIndexes()

 

 

예시)

db.getCollection('users').dropIndexes()

'Development > MongoDB' 카테고리의 다른 글

MongoDB / arrayFilters / 배열에서 다시 배열 조회  (0) 2020.06.25