google-cloud-firestore

How do you force a Firestore client app to maintain a correct document count for a collection?

被刻印的时光 ゝ 提交于 2020-03-09 05:43:12
问题 Firestore doesn't have a way to query for the size of a collection, so if a client app needs to know this value, it requires some maintenance of a document in another collection to hold this count. However, it requires that the client to correctly perform a transaction in order to keep this count up to date while adding and removing documents. A malicious or broken client could modify either the collection or the count independently, and create a situation where the count isn't accurate. It's

How would you structure mutual rating social network model on Firestore? [closed]

给你一囗甜甜゛ 提交于 2020-03-06 09:45:21
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 13 days ago . I think it would be easier to display my model with an example. The functionality of the app would be the following: It would be social network schema. A mutual friend model. When a user logins in the app, a list will be displayed. Each list item consist of a friend name -

How would you structure mutual rating social network model on Firestore? [closed]

左心房为你撑大大i 提交于 2020-03-06 09:44:08
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 13 days ago . I think it would be easier to display my model with an example. The functionality of the app would be the following: It would be social network schema. A mutual friend model. When a user logins in the app, a list will be displayed. Each list item consist of a friend name -

firestore OnCreate not triggered when creation is done by a sub document or collection

半城伤御伤魂 提交于 2020-03-05 05:54:09
问题 So I am building a chat app using flutter and firebase and I need to trigger a function whenever two new users starting chatting with each other for the first time (whenever one of them sent the first message) so I can store that information somewhere to show it later to the users as chat history (people who've got in contact with). So my data tree looks like this : 'rooms/{roomId}/messages/{messageWithRandomId}' Logically whenever a user sends the first message to another user the room

Model and Query data in Firestore to get items in directories

蹲街弑〆低调 提交于 2020-03-05 05:04:04
问题 I want to model data in firestore to get items in directories shared by several users (folders are secured with security rules). My current model is as follows: /folders/{folder}/folders/{subfolder} /folders/{folder}/items/{item} /folders/{folder}/folders/{subfolder}/items/{item} A user can access several folders and if he accesses the root folder he can also access the subfolders. He can also access subfolders (if he has permission) and his access to the root folder is restricted. The idea

Cannot read property 'toLowerCase' of undefined - REACT - FIRESTORE

99封情书 提交于 2020-03-05 03:40:30
问题 I'm a bit new to React and Firestore and already trying to figure out what is happening for a couple of hours. I Try to make my filter function working with data which I receive from Firestore in APP.js. I pass the data {tasks, searchTerm} to DASHBOARD component. The filter worked before when using state and props, but after replacing the hard-coded data in state with firestore data, it doesn't work anymore and I get the following error when filtering the array in the DASHBOARD component:

Can you create dynamic firebase queries?

故事扮演 提交于 2020-03-05 03:16:07
问题 I want to query firebase like so but it doesn't allow me. Is there a way to dynamically query firebase? I need to handle very specific cases - for example if the user selects "Doesn't Matter" then I need to remove that preference filter from the query, some of the fields are array datatypes and some are strings and some are numbers. I need to be able to handle all forms of datatypes and populate the where clause appropriately. Manually checking each field and calling out for each field will

Not able to access the data from firebase using StreamBuilder in flutter

时光总嘲笑我的痴心妄想 提交于 2020-03-05 03:13:42
问题 Here I am trying to get the data from the firebase database using firstore instance in streamBuilder . .collection('/message_data/friendA##friendB/message_list') :-this is my collection-document path from firebase No error, just a blank page. @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.friendName), ), body: Column( children: <Widget>[ Flexible( child: StreamBuilder( stream: Firestore.instance .collection('/message_data/friendA##friendB

Cloud Firestore rules - Allowing anybody to update one specific field in a document

余生长醉 提交于 2020-03-05 01:29:17
问题 I'm working on a PoC (Proof of Concept) application that users can download wallpapers to their device. All of the data is served using Cloud Firestore & Storage. There is NO LOGIN for this application. Anybody can download the application, and immediately download the wallpapers she or he desires. Bearing that in mind... I would like to have a counter that tracks how many times each specific wallpaper was downloaded. While I have it "working" - I am questioning the rules I have set up in

Plot Multiple Marker on Map-view From Firestore Cloud Database?

白昼怎懂夜的黑 提交于 2020-03-04 18:39:30
问题 I had Stored longitude & latitude in Firestore Collection and using Marker I Showed it On Map. but only one marker is displayed on a map. I want to show multiple markers on a map using stored longitude & latitude in Firestore Collection. Here is my java code package part.time.job.v2; import android.os.Bundle; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.fragment