Firebase 如何在CloudFireStore上编写查询以获取文档?

Firebase 如何在CloudFireStore上编写查询以获取文档?,firebase,google-cloud-firestore,angular8,Firebase,Google Cloud Firestore,Angular8,我想获取其收集电子邮件字段与asad12@gmail.com地址。 我怎么能用有角度的火箭弹做到这一点 您可以执行以下操作: constructor(private afs: AngularFirestore) {} const docRef = this.afs.doc('users/list'); const deviceRef = docRef.collection('devices', ref => ref.where('email', '==', 'asad12@gmail.co

我想获取其收集电子邮件字段与asad12@gmail.com地址。
我怎么能用有角度的火箭弹做到这一点

您可以执行以下操作:

constructor(private afs: AngularFirestore) {}
const docRef = this.afs.doc('users/list');
const deviceRef = docRef.collection('devices', ref => ref.where('email', '==', 'asad12@gmail.com')).valueChanges();
使用
where()
可以根据电子邮件的值进行查询
valueChanges()
返回一个可观测值,您可以使用方法
subscribe()
订阅该值以接收数据


您可以执行以下操作:

constructor(private afs: AngularFirestore) {}
const docRef = this.afs.doc('users/list');
const deviceRef = docRef.collection('devices', ref => ref.where('email', '==', 'asad12@gmail.com')).valueChanges();
使用
where()
可以根据电子邮件的值进行查询
valueChanges()
返回一个可观测值,您可以使用方法
subscribe()
订阅该值以接收数据


到目前为止,您尝试了什么?我还没有尝试,我在谷歌上搜索了很多,但没有找到解决此问题的具体方法。关于如何在Angular应用程序中进行Firestore查询,有大量文档。我建议您查看该文档,自己尝试一下,然后发布无法按预期方式工作的代码。到目前为止,你尝试了什么?我还没有尝试,我在谷歌上搜索了很多,但没有找到解决这个问题的具体方法。关于如何在Angular应用程序中进行Firestore查询,有很多文档。我建议您查看该文档,自己尝试一下,然后发布无法按预期方式工作的代码。谢谢,它工作正常。它被错误地点击了复选标记。它已经检查过了,谢谢。它被错误地点击了复选标记。它又检查了一遍