MongoDB의 구조와 Type

pengooseDev·2022년 12월 30일
0

MongoDB는 아래와 같은 구조를 가진다.

DataBase > Collection > Document


collection?

MySQL의 Table과 유사한 개념.
Collection 내부는에 Document를 가진다.


Document?

Document의 Type은 Key-Value로 이루어진 Binary JSON 데이터이다.
따라서, Object(JS, TS)딕셔너리(python) type의 데이터로 관리한다.
Document는 아래와 같이 여러개의 field를 가질 수 있다.

JS 예시

const mydoc = {
               _id: ObjectId("5099803df3f4948bd2f98391"),
               name: { first: "Alan", last: "Turing" },
               birth: new Date('Jun 23, 1912'),
               death: new Date('Jun 07, 1954'),
               contribs: [ "Turing machine", "Turing test", "Turingery" ],
               views : NumberLong(1250000)
}

Ref

> 공식문서

0개의 댓글