내가 SimpleSchema에 필드 아래에 사용하고 주어진 설정하지 않습니다. 문제는 빈 문자열 으로 필드를 업데이트 할 때 (즉, 텍스트 상자를 비워 두는 것) 일 때, 값 -
은 위의 SimpleSchema 코드에서 필드 정의대로 설정되지 않습니다.autoValue는 값
나는 아래로
clients.js:79 this {isSet: true, value: "", operator: "$unset", unset: ƒ, field: ƒ, …}
clients.js:80 typeof this.value.length number
clients.js:81 this.value.length 0 true true
clients.js:82 this.value string
clients.js:83 this.operator $unset
clients.js:84 this.isSet true
clients.js:86 if part ran.
clients.js:79 this {isSet: true, value: "-", operator: "$unset", unset: ƒ, field: ƒ, …}
clients.js:80 typeof this.value.length number
clients.js:81 this.value.length 1 false false
clients.js:82 this.value - string
clients.js:83 this.operator $unset
clients.js:84 this.isSet true
clients.js:89 else part ran.
를 로그를 얻고 내 컬렉션의 문서는 필드 fileNo
이 없습니다.
무엇이 누락 되었습니까? 원하는 값은 fileNo
의 값이 일 때 -
(하이픈)으로 설정해야합니다. 문서에서는 당신은이 상황을 처리해야 fileNo : "-"
정확히 무엇을 너 성취하려고? – Styx
@Styx : 마지막 줄을 굵게 수정했습니다. 미리 감사드립니다. –
아마, 'defaultValue'가 당신이 필요로하는 것일까요? – Styx