admin 管理员组文章数量: 1086019
I'm currently in a project using Firebase Cloud Firestore and VueJS.
I have this “where” clause, which needs the id of the selected collection. Basically it has to update, where the document id has the this.editSemId. There’s some other stuff to the method, but all I need is a way to get the document id from within my collection of semesters in firebase:
Here’s how it works:
.collection(“semesters”) .where(“DOCUMENT_ID”, “==”, this.editSemId)
I know how to “get” the document id, which is done with the “this.editSemId”, but I don’t know how to get it for the above query
I'm currently in a project using Firebase Cloud Firestore and VueJS.
I have this “where” clause, which needs the id of the selected collection. Basically it has to update, where the document id has the this.editSemId. There’s some other stuff to the method, but all I need is a way to get the document id from within my collection of semesters in firebase:
Here’s how it works: http://recordit.co/Hu67ekLWHv
.collection(“semesters”) .where(“DOCUMENT_ID”, “==”, this.editSemId)
I know how to “get” the document id, which is done with the “this.editSemId”, but I don’t know how to get it for the above query
Share Improve this question asked May 21, 2018 at 13:19 zetza hzetza h 951 silver badge10 bronze badges1 Answer
Reset to default 10You can use FieldPath.documentId() to make queries involving the document id.
.collection("semesters").where(FieldPath.documentId(), "==", this.editSemId)
本文标签: javascriptQuerying quotwherequot clause with document autoid firebaseStack Overflow
版权声明:本文标题:javascript - Querying "where" clause with document auto-id firebase - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744068594a2528071.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论