-
[MongoDB] projection공부/MongoDB 2022. 1. 9. 22:34
collection 중 조회하고싶은 field를 1 또는 true로 설정한다.
{key: 1} 또는 {key: true}
_id는 projection 사용 시 기본적으로 포함됨
_id를 제외하고 싶다면 💨
query문에 _id: 0 을 포함시켜준다
'공부 > MongoDB' 카테고리의 다른 글
[MongoDB] data types (0) 2022.01.11 [MongoDB] embedded documents & arrays (0) 2022.01.09 [MongoDB] find( ) (0) 2022.01.09 [MongoDB] CRUD Operations (0) 2022.01.09 [MongoDB] document의 _id를 지정해서 데이터 삽입하기 (0) 2022.01.03