일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 튜토리얼
- PyQt5
- 실시간 시계
- #if
- bootstrap
- VS Code
- flask
- href
- #undef
- jinja2
- 명령어
- Action
- 환경변수 설정
- DB 데이터
- bootstrap4 패키지
- openweathermap
- javascript
- DB 데이터 저장
- #endif
- 성능지표
- 콘솔 가상환경 # 콘솔 #가상환경
- 사이트 도메인
- #else
- OpenCV
- heroku
- #ifndef
- #ifdef
- OpenCV + Flask
- Django
- MySQL 세팅
- Today
- Total
PROGRAMMING
MongoDB 추가 내용 + Compass 본문
MongoDB 내부 구조, json file, command(명령어), MongoDB Compass, 환경변수 확인, 연동, MongoDB 특징, Compass filter
< MongoDB 내부 구조 >
1. 일반화
1) Database 생성
a) collection 생성
i) document 생성
※ mySQL 구조
1) database
a) table (MongoDB에서의 collection)
i) column (MongoDB에서의 document)
※ DB의 document에는 field가 존재
2. 실습
1) Kim-db 생성
a) books 생성
i) title 생성
- title: 맛있는 mongo
- author: ...
- price: 25000
< json file >
json: javaScript에서 사용되며 data object를 전달하기 위해 읽기 가능한 텍스트를 사용하는 표준 포맷 방식
★ 간단하게 말하면 { 키 : 값 }으로 구성된 포맷 방식
< command >
help : 사용가능한 명령어 확인
db : 생성된 database 확인
use DB_name : 사용할 db 지정 ( 없는 경우 생성 )
show dbs : db 사용 공간 확인
db.books.insert( { title:'맛있는 mongodb', author:'정승호', price:25000 } )
- ※ ( ) : json(javaScript 기준) 포맷 형식 기재
- books : collection
- ( ) 안의 내용 : document
db.books.find()
- collection 전체 확인
db.stats() : DB 통계수치 확인
※ (작성일 기준) javaScript 에 대한 문법 지식이 없기 때문에 MongoDB Compass 프로그램을 활용
※ 저장된 DB를 차후 클라우드에 영속화
< MongoDB Compass >
< 환경변수 - data 확인 >
: DB data 루트(default / 뒷장에 custom으로 data를 저장할 위치 정하는 부분 있음 mongod --dbpath)
< Compass 및 cmd.exe 간의 연동여부 확인 결과 >
< 기존 DB는 정형데이터만 처리하므로, 값의 형태나 순서가 달라지면 에러를 발생시킴
But, MongoDB의 경우 비정형데이터를 처리하기 때문에 값의 형태나 순서에 구애받지 않음 >
※ 식별할 수 있는 Key : primary key = ObjectId
< Compass Filter >
https://docs.mongodb.com/compass/current/query/filter
Query Your Data — MongoDB Compass
If you do not have a MonogDB deployment or if you would like to query a large sample data set, see Sample Data for Atlas Clusters for instructions on creating a free-tier cluster with sample data. Note that the examples below are intended to filter the sam
docs.mongodb.com
'Database > MongoDB' 카테고리의 다른 글
웹 크롤링(Web crawling) + Tip (0) | 2021.01.15 |
---|---|
Pycharm (0) | 2021.01.15 |
MongoDB Atlas + 간단한 javaScript (0) | 2021.01.15 |
MongoDB 설치 (0) | 2021.01.15 |
MongoDB 개요 (0) | 2021.01.15 |