0
mongodb에서 데이터의 유효성을 검사하고 저장하는 데 JSON 스키마를 사용하고 있습니다. "필수"와 같은 새 키 값 쌍을 정의하여 개체보기 2 개 상세하고 다른 것은 관례입니다. 먼저이 같은 스키마를 작성하거나 표준 키 값을 사용할 수 있습니까?개체의 2보기를 만들기위한 JSON 스키마의 새 필드 정의
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Product set",
"type": "array",
"items": {
"title": "Product",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier for a product",
"type": "number"
},
"name": {
"type": "string"
},
"price": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true
}
},
"required": ["id", "name", "price"]
"customViewField" : ["name", "price"]
}
}
나를 위해이 작업을 수행하는 파서가 있습니까? (하나의 객체에 2 개의 getter를 지정하고 사용자 정의하려는 경우)