| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 |
- 중고나라
- 취약점
- 변태는
- 안전결제
- aes
- Sequoia
- 네이버카페
- Frida
- mitmproxy
- EC2
- AWS
- ue4dumper
- 모의해킹
- shell_gpt
- Malware Sample
- ssrf
- XSS
- LFI
- intelmac
- 많다..
- cve-2025-55182
- S3
- 허리디스크
- 척추관협착증
- jeb_mcp
- 채팅환전사기
- react2shell
- 내부확산
- ChatGPT
- 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" } } |
'데이터베이스' 카테고리의 다른 글
| AWS CPUUtilization (0) | 2026.01.12 |
|---|---|
| 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 |