기본 구조

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 확인