connection - 데이터베이스
Collection - 관계형DB에서 테이블
Document - 관계형DB에서 데이터 하나의 row
field - 관계형DB에서 column
index - index
ex.
{
"_id" : ObjectId("65540c94b0672aca250c4b1e"),
"cust_id" : "A2012001",
"order_date" : ISODate("2018-04-30T00:00:00.000+0000"),
"status" : "A",
"price" : NumberInt(50),
"items" : [
{
"item_name" : "Bunny Boots",
"qty" : NumberInt(15),
"price" : 2.5
},
{
"item_name" : "Skey Pole",
"qty" : NumberInt(5),
"price" : 2.5
}
]
}
여기서 connection은 test(DB)
Collection은 order(테이블)
예시 전체가 하나의 document이고
Field는 "cust_id", "order_date", "status", "price", "items" 등이 각각 필드에 해당함
index는 위의 예시에서는 특정 인덱스를 명시적으로 보여주지는 않지만, MongoDB는 기본적으로 모든 문서의 "_id" 필드에 대한 인덱스를 자동으로 생성