-
mongoose.Schema : default: () => []스터디노트/DB 2022. 5. 9. 13:59
Schema 만들기
mongoose.Schema({ email : { type : [{type : String}], default : () => [], }, });
default : () => []
- default Array 또는 Object를 표기하는 방법
default : () => [], default: function () { return [] }
'스터디노트 > DB' 카테고리의 다른 글
MongoDB 필드를 참조하여 업데이트 하기 (0) 2022.06.16 MongoDB Aggregation (0) 2022.05.10 mongoDB compass에서 간단한 쿼리 날려보기 (Aggregate, $match, $project, $expr, $lookup, ...) (0) 2022.04.22 new mongoose.Schema VS mongoose.Schema (0) 2022.04.18 mongoose.Schema에서 enum이란?? (0) 2022.04.18 - default Array 또는 Object를 표기하는 방법