1. mongdb 실행 및 기본 db확인
C:\Users\anodos>mongo
MongoDB shell version v4.2.18
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("a675e7b8-400a-4618-966c-353842db7f1b") }
MongoDB server version: 4.2.18
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
https://docs.mongodb.com/
Questions? Try the MongoDB Developer Community Forums
https://community.mongodb.com
Server has startup warnings:
2022-03-03T19:25:10.430+0900 I CONTROL [initandlisten]
2022-03-03T19:25:10.430+0900 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2022-03-03T19:25:10.430+0900 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2022-03-03T19:25:10.430+0900 I CONTROL [initandlisten]
---
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).
The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.
To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
>
2. DB 생성 및 데이터 입력
> use firstdb
switched to db firstdb
>
> db
firstdb
> db.firstCollection.insertOne({x:1})
2022-03-03T19:33:31.699+0900 E QUERY [js] uncaught exception: SyntaxError: unexpected token: identifier :
@(shell):1:3
> db.firstCollection.insertOne({x:1})
{
"acknowledged" : true,
"insertedId" : ObjectId("6220998f84c843a7ff046abe")
}
>
3. compas data 확인
'빅데이터 & 인공지능' 카테고리의 다른 글
4.빅데이터가 만들어 내는 본질적 변화 (0) | 2023.06.29 |
---|---|
데이터분석전문가 가이드 목차 (0) | 2023.06.29 |
MongoDB 설치 (0) | 2022.03.03 |
Spark MLlib(Spark Machine Learning Library) (0) | 2022.02.21 |
Spark RDDs vs DataFrames vs SparkSQL 성능비교 (0) | 2022.02.21 |