Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- insertOne
- 서브쿼리
- subquery
- 파이썬
- sqlite3
- PostgreSQL
- javascript
- onetoone
- SubqueryFilter
- insert_into
- sql
- 자바스크립트
- MongoDB
- python
- Join
- 밴쿠버응급실
- PostgresDB
- postgres
- statement
- query
- DATABASE
- 데이터베이스
- DB
- 몽고디비
- DBFilter
- python데이터베이스연동
- MySQL
- PreparedStatement
- Collections
- cursor()
Archives
- Today
- Total
새벽코딩
Mongo DB 기초 (with updateOne) 본문
Mongo DB 설치 후 실행
wsl 창에 아래와 같이 실행
~$ sudo service mongodb start
~$ mongo
#현재 저장된 Database를 다 보여준다.
> show dbs
#그 중 test로 지정
> ues test
#test 안에 들어있는 collections 보여준다.
> show collections
#cities 안에 들어있는 요소 보기
> db.cities.find()
# "name"이 "Vancouver"인것의 "description을 "rain"으로 바꿔보자.
db.cities.updateOne({"name":"Vancouver"}, {"$set":{"description":"rain"}});
다시 조회를 해보면, 위와 같이 description이 rain으로 변경되었다. (빨간줄 부분)