google-cloud-firestore

Firestore query with where(in:) and where(isEqual:)

白昼怎懂夜的黑 提交于 2020-08-10 19:23:07
问题 Is the following composite where(in:) and where(isEqualTo:) query possible in Firebase Firestore? (Swift) let taskDocIds = ["0ArJnMgTfDkvolUcZR8E", "0cdcZsfaEJQpsiByJIgH"] return db.collection("tasks") .whereField("status", isEqualTo: "approved") .whereField(Firebase.FieldPath.documentID(), in: taskDocIds) .limit(to: 100) .getDocuments(as: TaskModel.self) My security rules enforce that only tasks with status as approved may be read. However the the query above results in an error (see below)

Using Firestore DB, how can I break out of a for loop inside of a snapshot listener when a certain condition is met?

血红的双手。 提交于 2020-08-10 19:17:23
问题 I'm trying to break out of this listener once this condition if myDay == self.daysOfWeek[self.picker.selectedRow(inComponent: 0)] is met, but I'm not getting the results that I'm looking for. Once the condition is met, it just continues to loop through all the documents. How do I code this up properly? let addAction = UIAlertAction(title: "Add Workout", style: .default) { (UIAlertAction) in if self.dayCount != 0 { print("\(self.dayCount)") self.colRef.addSnapshotListener { (querySnapshot, err

How Firestore billing works in case of exact same query from different sources?

故事扮演 提交于 2020-08-10 19:16:49
问题 Confusion with Firestore billing never ends! Lets say I have an Android app with bottom navigation, in which, one of the menus is displying some documents from a collection using a real-time listener. Now, it is very common for user to jump from one nav-menu to other in a short period of time. This is handled by replacing fragments, resulting in creation of new Query object on each onStart . Similar situation may happen in case of Activities. This answer says that for every new Query object,

How Firestore billing works in case of exact same query from different sources?

半世苍凉 提交于 2020-08-10 19:16:13
问题 Confusion with Firestore billing never ends! Lets say I have an Android app with bottom navigation, in which, one of the menus is displying some documents from a collection using a real-time listener. Now, it is very common for user to jump from one nav-menu to other in a short period of time. This is handled by replacing fragments, resulting in creation of new Query object on each onStart . Similar situation may happen in case of Activities. This answer says that for every new Query object,

Getting snapshot size of cloud firestore collection in web javascript [duplicate]

杀马特。学长 韩版系。学妹 提交于 2020-08-10 19:07:07
问题 This question already has answers here : Cloud Firestore collection count (16 answers) Closed 5 days ago . I am developing a web application with javascript using a cloud firestore as a database. In my database, I have around 400 000 documents in a collection. when I wrote a query to get the snapshot size my website is going to debugging state and will never return the size. db2.collection("Products").get().then(function(querySnapshot) { querySnapshot.forEach(function(doc) { // console.log

Getting snapshot size of cloud firestore collection in web javascript [duplicate]

南楼画角 提交于 2020-08-10 19:07:05
问题 This question already has answers here : Cloud Firestore collection count (16 answers) Closed 5 days ago . I am developing a web application with javascript using a cloud firestore as a database. In my database, I have around 400 000 documents in a collection. when I wrote a query to get the snapshot size my website is going to debugging state and will never return the size. db2.collection("Products").get().then(function(querySnapshot) { querySnapshot.forEach(function(doc) { // console.log

Flutter pagination with firebase not working for me

天大地大妈咪最大 提交于 2020-08-10 18:53:30
问题 I tried two posibilities but the firebase data isnt being stored in the products list.The app page returns no data as there is nothing in procucts list. foollowing list returns data succesfully.The second possibilty that i tried and the Consolelog is in this pastebin link below: https://pastebin.com/DM47YHY6 List<String> foollowingList = []; List<NetworkImage> _listOfImages = <NetworkImage>[]; List<DocumentSnapshot> products = []; // stores fetched products bool isLoading = true; // track if

Flutter pagination with firebase not working for me

こ雲淡風輕ζ 提交于 2020-08-10 18:53:09
问题 I tried two posibilities but the firebase data isnt being stored in the products list.The app page returns no data as there is nothing in procucts list. foollowing list returns data succesfully.The second possibilty that i tried and the Consolelog is in this pastebin link below: https://pastebin.com/DM47YHY6 List<String> foollowingList = []; List<NetworkImage> _listOfImages = <NetworkImage>[]; List<DocumentSnapshot> products = []; // stores fetched products bool isLoading = true; // track if

Having issues saving my user data in Firebase storage during account signup using Flutter

六月ゝ 毕业季﹏ 提交于 2020-08-10 18:52:36
问题 So on signup, the user will enter their name, username, along with the email and a password. On submit, the user's email and id are the only things that are delivered to Firebase but profileName is "" and username is null. I'm only expecting a value for username and profileName, everything else should still be "". This is from SignUpPage.dart I'm not sure if I did that loggedInUser part right by adding username: user.displayName and profileName: user.displayName. I did that because I saw

Error: `call FirebaseApp.configure() before using Firestore`

前提是你 提交于 2020-08-09 19:09:33
问题 Background Info I have started developing a backend for an simple App, and I have set up a database class (named DBDelegate ) that all the files will communicate with. In my AppDelegate.swift I have this: static public var dbDelegate:DBDelegate = DBDelegate() private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. FirebaseApp.configure()