2021-1/RDA

MongoDB | 기본 명령어 숙지하기

이망고_ 2021. 10. 4. 11:47

  • db : 현재 사용중인 데이터베이스 확인
  • show dbs : 데이터베이스 리스트 확인
  • show collections : 콜렉션 확인 
  • db.stats( ) : 데이터베이스 상태 확인
  • db.cities.save({ name : "Seoul" }) 
  • db.cities.find( )
  • config = { } 
  • rs.initiate(config) : 초기화
  • rs.status( ) : Replica Sets 상태를 확인