Javascript 使用Firestore查询发送值

Javascript 使用Firestore查询发送值,javascript,angular,firebase,google-cloud-firestore,angularfire,Javascript,Angular,Firebase,Google Cloud Firestore,Angularfire,是否有任何方法可以通过每个或单个Firestore查询发送自定义值,如下所示: this.fireStore.doc(`users/${user.uid}`).valueChanges() 我需要发送一个值来访问Firebase规则,如 allow=true 例如: this.fireStore.doc(`users/${user.uid}`).params({allow:true, healthy:good}).valueChanges() 不,那是不可能的。document gets的

是否有任何方法可以通过每个或单个Firestore查询发送自定义值,如下所示:

this.fireStore.doc(`users/${user.uid}`).valueChanges()
我需要发送一个值来访问Firebase规则,如

allow=true
例如:

this.fireStore.doc(`users/${user.uid}`).params({allow:true, healthy:good}).valueChanges()

不,那是不可能的。document gets的安全规则只能查看文档和中自己的值。您可能希望了解如何使用所获取文档中的值,例如,安全规则如下所示

allow read: resource.data.public == true
allow read: request.auth.token.admin === true

您可以查看它们是否是用户属性,例如if admin等,以及它的安全规则,例如类似这样的内容

allow read: resource.data.public == true
allow read: request.auth.token.admin === true

你能举一个你想发送的变量的例子吗?@JackWoodward我加了一个例子谢谢。不,那是不可能的。document gets的安全规则只能查看文档和请求对象中自己的值。您可能希望查看如何使用正在获取的文档中的值,或者如果自定义身份验证声明是用户属性-@JackWoodward,则可以查看它们thanks@JackWoodward这听起来像个答案。:-)