Pure Software Engineer :)
[MongoDb] Command 본문
회사에서 플랫폼 모니터링을 위해 MongoDb에 데이터를 쌓고 있는데
Shell을 통해 데이터를 확인할 일이 가끔있다.
자주 사용하는 command를 몇가지 기록해두고자 한다.
// 가장 오래된 문서 찾기
> db.[collectionName].find().sort({_id:1})
// 가장 최신 문서 찾기
> db.[collectionName].find().sort({_id:-1})
// data export
> mongoexport.exe --host [111.222.333.444:27017] -u [id] -p [password] -d [database]-c [collection] -o result.json
> mongoexport.exe --host [111.222.333.444:27017] -u [id] -p [password] -d [database]-c [collection] --csv -f [fieldname[,...]]-o result.csv
'Software Engineering' 카테고리의 다른 글
Docker image로 Redis Cluster 쉽게 실행하기 (0) | 2023.03.20 |
---|---|
VI에서 swift syntax highlight 하는 방법 (0) | 2015.07.26 |
[Redis] Redis data structure (0) | 2014.11.20 |
Google App Engine 'Hello world' using python SDK (0) | 2013.08.10 |
[C++] new operator (0) | 2013.07.22 |