일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 허리디스크
- 안전결제
- 취약점
- 네이버카페
- shell_gpt
- self-signed
- ssrf
- CryptoJS
- NUGU
- Frida
- react
- 거래사기
- 척추관협착증
- esbuild
- 로맨스스캠
- CJ대한통운 #쿠팡 #통관번호오류 #통관고유번호오류 #안주원팀장 #모건인베스트
- Malware Sample
- Sequoia
- 중고나라
- XSS
- intelmac
- 많다..
- 모의해킹
- 채팅환전사기
- open redirect
- MongoDB #NoSQL #CreateUser #DropUser #mongod #mognod.conf
- 보이스피싱 #대검찰청 #명의도용 #비밀번호 #계좌번호 #공공기관 #가짜검찰청
- ue4dumper
- speed-measure-webpack-plugin
- 변태는
- Today
- Total
annyoung
[mongodb] how to find dictionary not null 본문
{ "_id" : ObjectId("5a129bde1c6fcc3ea4d21db0"), "email" : "test@gmail.com", "name" : "test", "authType" : "google", "loc" : { "country" : "US" } }, { "_id" : ObjectId("5a129bde1c6fcc3ea4d21db0"), "email" : "test2@gmail.com", "name" : "test2", "authType" : "google", "loc" : {} }, { "_id" : ObjectId("5a129bde1c6fcc3ea4d21db0"), "email" : "test3@gmail.com", "name" : "test3", "authType" : "google", "loc" : {} }, { "_id" : ObjectId("5a129bde1c6fcc3ea4d21db0"), "email" : "test4@gmail.com", "name" : "test4", "authType" : "google", "loc" : { "country" : "US" } } |
You have to know object's dictionary key.
If you want find loc(dictionary) not null data, using next query.
db.users.find({"loc.country":{$exists:true}}) |
debug result
{ "_id" : ObjectId("5a129bde1c6fcc3ea4d21db0"), "email" : "test@gmail.com", "name" : "test", "authType" : "google", "loc" : { "country" : "US" } }, { "_id" : ObjectId("5a129bde1c6fcc3ea4d21db0"), "email" : "test4@gmail.com", "name" : "test4", "authType" : "google", "loc" : { "country" : "US" } } |
'데이터베이스' 카테고리의 다른 글
mongodb combine two queries with aggregate (0) | 2022.01.25 |
---|---|
MongoDB 유저생성 및 데이터베이스 생성 (0) | 2019.01.08 |
Install MongoDB + phpMongoDriver in Mac OSX High Sierra (0) | 2018.09.13 |
mongodb not authorized? how to create database in mongodb (0) | 2018.04.18 |