google-cloud-firestore

Firestore array-contains-any is not working properly

こ雲淡風輕ζ 提交于 2020-01-22 02:30:08
问题 "@angular/fire": "5.2.3", "firebase": "7.4.0", Note: members is an array and 0,1,2 is map data structures. service.ts getUserChatGroups(uid: string): Observable<DocumentChangeAction<MessageGroupMemberModel>[]> { return this.afs.collection<MessageGroupMemberModel>(`messageGroups`, ref => ref.where('members', 'array-contains-any', [uid])).snapshotChanges(); } page.ts init(): void { const uid: string = this.authService.getUserUid(); this.chatService.getUserChatGroups(uid).subscribe(res => {

How to save loaded data from Firestore to Arraylist

对着背影说爱祢 提交于 2020-01-22 02:29:28
问题 I'm using Firestore to keeping data. I want to load data and save it in Array. @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate( savedInstanceState ); setContentView( R.layout.activity_map ); searchText = (AutoCompleteTextView) findViewById( R.id.search ); gpsImage = (ImageView) findViewById( R.id.gps_btn ); info = (ImageView) findViewById( R.id.info_btn ); cafe = (ImageView) findViewById( R.id.cafe_btn ); cafelist_btn = (ImageView)findViewById( R.id

Firebase efficiently model nXn relationship

你说的曾经没有我的故事 提交于 2020-01-22 02:19:09
问题 Let's say I have the following scenario: I have multiple events, that multiple users can attend. Also, users can attend multiple events. What's the best way of storing the required information with maintaining data consistency? Here's what I came up with and why I don't really fancy them: collection "events" -> event document -> subcollection "users" -> user document Problem: Each user exists on each event, resulting in multiple documents of each user. I can't just update user information as

Storing asynchronous Cloud Firestore query results in Swift

旧城冷巷雨未停 提交于 2020-01-22 02:18:25
问题 I am working on a simple project using Swift 5, SwiftUI and Firebase which cycles through given ids in an array, searching in the Cloud Firestore database for each id, and appending the corresponding name associated with the id to a new array. Here is a picture of my database: For example, I am given an array a few ids, then for each element in the given array, I get the document associated with that id, then print the "firstname" field in that document. However, I want to store each

Firestore limit

梦想与她 提交于 2020-01-21 23:32:38
问题 Firestore offers 50000 documents read operations as part of its free bundle. However, in my application, the client is fetching a collection containing price data. The price data is created over time. Hence, starting from a specific timestamp, the client can read up to 1000 documents. Each document represents one timestamp with the price information. This is means that if the client refreshes his/her web browser 50 times, it will exhaust my quota immediately. And that is just for a single

Firestore limit

老子叫甜甜 提交于 2020-01-21 23:32:34
问题 Firestore offers 50000 documents read operations as part of its free bundle. However, in my application, the client is fetching a collection containing price data. The price data is created over time. Hence, starting from a specific timestamp, the client can read up to 1000 documents. Each document represents one timestamp with the price information. This is means that if the client refreshes his/her web browser 50 times, it will exhaust my quota immediately. And that is just for a single

Firestore increment floating points issue

不打扰是莪最后的温柔 提交于 2020-01-21 19:43:36
问题 Note that I know there have been some other questions, but no real answer, on SO, regarding this issue. So, what has been happening since the increment field value was implemented, is that when incrementing floating numbers, most of the time you'll get a dozen decimals instead of the actual number. // incrementing 0, with 0.1, 11 times, returns 1.0999999999999999 Math.round( 1.0999999999999999 * 100 + Number.EPSILON ) / 100 This returns the correct number ... so I wonder, can't this be

Firestore increment floating points issue

限于喜欢 提交于 2020-01-21 19:42:46
问题 Note that I know there have been some other questions, but no real answer, on SO, regarding this issue. So, what has been happening since the increment field value was implemented, is that when incrementing floating numbers, most of the time you'll get a dozen decimals instead of the actual number. // incrementing 0, with 0.1, 11 times, returns 1.0999999999999999 Math.round( 1.0999999999999999 * 100 + Number.EPSILON ) / 100 This returns the correct number ... so I wonder, can't this be

How to fetch collection from firebase cloud firestore into a ViewPager?

余生长醉 提交于 2020-01-21 19:18:12
问题 friends I just implement code for the View pager. But now I am stuck with the problem that how to fetch a collection from the firestore into a view pager. Means I have a collection in that collection I have 2 documents. each document has some parameters. I want the "mSliderImage" parameter will be fetched into a ViewPager from each and every document. My Code Some How Looks Like This. I am using some dependencies for my custom viewpager. implementation 'com.github.smarteist:autoimageslider:1

Firebase aggregate values over property without fetching all relevant documents

这一生的挚爱 提交于 2020-01-21 18:45:15
问题 I have the following firebase structure: { "company1": { "name": "Company One", "invoices": { "invoice1": { "amount": 300, "currency": "EUR", "timestamp": 1572608088 }, "invoice2": { "amount": 460, "currency": "EUR", "timestamp": 1572608088 } } } } That is to say: I have a collection companies . There is a document for each company. Each company has a subcollection invoices . Each invoice has the properties amount , currency , timestamp . Is there an efficient way of getting the sum of all