| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
- 허리디스크
- 척추관협착증
- 모의해킹
- 채팅환전사기
- 네이버카페
- 내부확산
- esbuild
- Malware Sample
- shell_gpt
- jeb_mcp
- 중고나라
- speed-measure-webpack-plugin
- EC2
- 많다..
- cve-2025-55182
- mitmproxy
- intelmac
- 안전결제
- 변태는
- 취약점
- react2shell
- AWS
- XSS
- LFI
- self-signed
- Sequoia
- S3
- Frida
- aes
- ue4dumper
- 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 |
