google-cloud-firestore

How to perform collection group query using document ID in Cloud Firestore

吃可爱长大的小学妹 提交于 2020-08-27 18:11:32
问题 So few day ago I moved my apps posts to cloud firestore from realtime database because of the more flexable querying that firestore apparently has. I have been modifying my code to work with firestore as the new database. Now I ran into a problem. How can I retrieve every document within "Posts" collection that has "Likes" collection that contains a specifically named document? I don't know if that makes sense so here's an image showcasing the problem: I had a working query for firebase

How to perform collection group query using document ID in Cloud Firestore

淺唱寂寞╮ 提交于 2020-08-27 18:09:10
问题 So few day ago I moved my apps posts to cloud firestore from realtime database because of the more flexable querying that firestore apparently has. I have been modifying my code to work with firestore as the new database. Now I ran into a problem. How can I retrieve every document within "Posts" collection that has "Likes" collection that contains a specifically named document? I don't know if that makes sense so here's an image showcasing the problem: I had a working query for firebase

Angular app with Firebase data: why am I seeing data from the previous page?

删除回忆录丶 提交于 2020-08-27 07:48:14
问题 So, I have an Angular 9 app hosted on Firebase and using Firestore for the data. I have an issue that seems very simple but I can't wrap my head around why it's happening. I've simplified the app a lot to find the root cause of this and will try to explain the issue as well as I can below. The app : I have 2 pages, one Homepage, and one Transactions page. Both pages are reading from the same Firebase collection "transactions". However, on the Home page, I want to show the 4 most recent

Firestore - Pass Array To arrayUnion()

扶醉桌前 提交于 2020-08-27 02:17:46
问题 How do you pass an array to the firebase firestore arrayUnion() function? I am getting this error when I try to pass an array. Error Error: 3 INVALID_ARGUMENT: Cannot convert an array value in an array value. Example let myArray = ["1", "2", "3"]; docRef.update({ test: firebase.firestore.FieldValue.arrayUnion(myArray) }); 回答1: I eventually found the answer of using Function.prototype.apply() in another stack overflow answer. Example For Function.prototype.apply() let myArray = ["1", "2", "3"]