좌측은 mongo 실행 우측은 mongod을 실행한 것 입니다.
https://docs.mongodb.com/manual/core/document/
Documents — MongoDB Manual
Docs Home → MongoDB ManualMongoDB stores data records as BSON documents. BSON is a binary representation of JSON documents, though it contains more data types than JSON. For the BSON spec, see bsonspec.org. See also BSON Types.MongoDB documents are compo
docs.mongodb.com
find() 명령어는 products에 어떤 정보가 있는지 알려주는 것이다.
find({name : "Pencil"})로 찾고 싶은 데이터를 지정하면 딱 그 정보만 알려준다.
find({price: {$gt: 1}}) 1 보다 큰 이라는 의미이다. $gt
프로젝션을 0 으로 설정하면 해당 column이 보이지 않는다.
acknowledged 작업승인 , machedCount 쿼리가 하나의 문서와 일치함 modifiedCount 1개 수정
delete
vsc 에 먼저 가독성이 좋게 만들어서 cmd에 붙여넣기 하는 방법이다.
npm init -y 를 사용하면
귀찮게 Enter 안쳐도된다.
https://docs.mongodb.com/drivers/node/current/quick-start/
Quick Start — Node.js
Docs Home → Node.jsThis guide shows you how to create an application that uses the Node.js driver to connect to a MongoDB Atlas cluster. If you prefer to connect to MongoDB using a different driver or programming language, see our list of official driver
docs.mongodb.com
MongoDB Node.js 드라이버, 간단하게 시작해보기
https://mongodb.github.io/node-mongodb-native/3.2/quick-start/quick-start/ Quick Start 부분을 번역함. + 추가 예시 해당 포스트에서는 운영체제가 Windows 10 이었다. **++ Mac 버전도 추가해두었다.** 1...
nangkyeong.tistory.com
이부분을 app.js에 붙여넣기한다.
'공부기록' 카테고리의 다른 글
어플리케이션 배포 Mongo Atlas (0) | 2022.01.27 |
---|---|
몽구스 (0) | 2022.01.27 |
몽고디비 (0) | 2022.01.25 |
데이터베이스 (0) | 2022.01.25 |
Lodash (0) | 2022.01.25 |