2017-11-19 5 views
2

어레이.경우 FireStore : 동일한 키 (<code>propertyA</code>, <code>propertyB</code>)과 같은 유형의 값 (<code>string</code>)와 객체의 배열 : I는 다음과 같은 데이터 구조를 검증하는 용액 바라는 객체의 유효성

{ 
    title: 'Hello World', 
    toValidate: [ 
    { 
     propertyA: 'string', // Always the same keys 
     propertyB: 'string' // Always a string 
    }, 
    { 
     propertyA: 'string', 
     propertyB: 'string' 
    } 
    ] 
} 
+0

이 또한 궁금합니다. 'typeof'연산자가 존재하지 않기 때문에 필드 데이터 유형을 검사 할 방법이없는 것처럼 보입니다. – JussiR

+0

제 잘못입니다. 유형을 확인하기 위해 'is'연산자가 있습니다. https://firebase.google.com/docs/firestore/reference/security/#resource – JussiR

답변

0

아마 하위 수집을 찾고 있습니다. 그들은 그들 자신의 검증 규칙을 가질 수 있습니다.

+0

예가 있습니까? – purii

+0

일치하는 하위 모음의 예는 다음에서 확인할 수 있습니다. https://firebase.google.com/docs/firestore/security/rules-structure#hierarchical_data – JussiR

+0

그런 다음 jus는 "문자열입니다."등의 유효성 검사 규칙을 위의 코멘트. – JussiR