EunsooD

mongoDB distinct 상세하게 찾을 때 본문

카테고리 없음

mongoDB distinct 상세하게 찾을 때

EunsooD 2015. 9. 23. 11:36
반응형

distinct로 어떤 정보들이 있는지 보고 싶을 때가 있는데,

이때 어느 정보에 해당하는 것만 보려고 하면 where를 밑에 처럼 주면 된다.


db.tables.distinct("addr",{app:"test"})


그러니깐 tables라는 테이블에서 app이 test인 것들 중에 addr의 종류를 모두 보는 것이라고 생각하면 된다.

반응형
Comments