Robo3T 로 보는게 편하다.
맨날 까먹는 MongoDB 명령어 모음집
DB조회
show dbs
컬렉션 조회
use test; //db선택. 없을 때는 만들어짐.
show collections;
전체 조회
db.getCollection('collectionName').find()
db.getCollection('collectionName').find().pretty
조건 조회
컬럼명="테스트" 인 document 조회
db.getCollection('collectionName').find("컬럼명":"테스트")
특정 필드 업데이트
db.collectionName.update( { name: "song" }, { $set: { age: 31 } } )
도큐먼트 업데이트
db.collectionName.update( { name: "song" }, { "name": " song update", age: 32 })
특정 필드 삭제
db.collectionName.update ( { name: "song" } , { $unset: { age: 32 } } )
'IT 잡동사니' 카테고리의 다른 글
Ubuntu OpenLDAP 설치 (0) | 2024.07.01 |
---|---|
Zeppelin 설치(Windows) - UI 안나오는 이슈 해결, 원격 접속 허용 (0) | 2024.07.01 |
Zeppelin spark interpreter 연동 (0) | 2024.07.01 |
데이터 중심 애플리케이션 설계 - 복제 (0) | 2022.09.12 |
IntelliJ Google style fomatter를 적용해보자! + 매크로 등록 (0) | 2022.05.15 |