google-cloud-firestore

How to update fields in Firestore map

做~自己de王妃 提交于 2020-12-13 09:36:53
问题 Don't know how to go about adding new fields into a map in Firestore using a variable rather then a hardcoded field name. I have a data structure in firestorm. The collection is called webQuiz and the document is called '12345. The data structure looks like: roomName: Demo0 roomNumber: 46532 people:{11111:"David, 22222:"Peter} Note that people is a map data object. I would like to add another field to the people map. The code below works but instead of the data looking like people:{11111:

How to update fields in Firestore map

时光怂恿深爱的人放手 提交于 2020-12-13 09:35:10
问题 Don't know how to go about adding new fields into a map in Firestore using a variable rather then a hardcoded field name. I have a data structure in firestorm. The collection is called webQuiz and the document is called '12345. The data structure looks like: roomName: Demo0 roomNumber: 46532 people:{11111:"David, 22222:"Peter} Note that people is a map data object. I would like to add another field to the people map. The code below works but instead of the data looking like people:{11111:

GridView with Flutter and Firestore

∥☆過路亽.° 提交于 2020-12-13 05:45:23
问题 I`m trying to make a simple GridView from a cloud firestore record. I've followed a lot of video tutorials but without success. Here's the code: import 'package:flutter/material.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; class EventList extends StatefulWidget { @override EventListState createState() => new EventListState(); } class EventListState extends State<EventList> { @override Widget build(BuildContext context) { return StreamBuilder( stream: Firestore.instance

Google Firestore error getting database instance

两盒软妹~` 提交于 2020-12-13 04:37:04
问题 I am trying to add information to my firebase project using Xamarin android app but all of a sudden I got this message: Error Message Java.Lang.NoClassDefFoundError Message=Failed resolution of: Lcom/google/common/base/Preconditions; My GetDatabase method: Imgur Link NuGet Packages Installed: Xamarin.Android.Support.Core.Utils (ver 28.0.0.3) Xamarin.Android.Support.CustomTabs (ver 28.0.0.3) Xamarin.Android.Support.Design (ver 28.0.0.3) Xamarin.Android.Support.Media.Compat (ver 28.0.0.3)

Check a document field for a specific value in Cloud Firestore

孤街醉人 提交于 2020-12-13 04:09:36
问题 I want to create a user registration with custom usernames. I store the user's username on a user document in Firestore. How can I validate a username already exists in my Users Collection? Maybe someone already have snippet for reactive form validation? 回答1: There is no efficient way to check all documents in a collection for a specific value. You would have to read each document in turn, and check them. That is prohibitive both from a performance and a cost standpoint. What you can instead

How to set, get and update data to the cloud firestore in flutter?

徘徊边缘 提交于 2020-12-13 03:46:45
问题 I tried some code but getting an exception. The Exception that I'm getting: java.lang.IllegalArgumentException: Invalid document reference. Document references must have an even number of segments, but Users has 1 I searched for it, according to this, Document references must have an even number of segments like: Collection - document - Collection - document - Collection - document Query for getting data from firestore: String getIsNewUSer; Firestore.instance.collection('Users').document(uid)

How to set, get and update data to the cloud firestore in flutter?

让人想犯罪 __ 提交于 2020-12-13 03:46:08
问题 I tried some code but getting an exception. The Exception that I'm getting: java.lang.IllegalArgumentException: Invalid document reference. Document references must have an even number of segments, but Users has 1 I searched for it, according to this, Document references must have an even number of segments like: Collection - document - Collection - document - Collection - document Query for getting data from firestore: String getIsNewUSer; Firestore.instance.collection('Users').document(uid)

How to subscribe array of Observable Forkjoin not working

笑着哭i 提交于 2020-12-13 03:43:10
问题 I am trying to do multiple HTTP requests in angular using forkjoin.But when I subscribe to Observable it doest not give any response. let data = this.email.map((email) => this.get_student_service.get_student_by_email_id(email) ); forkJoin([data]).subscribe((res) => { console.log(res); }); console.log('Execute'); Here is my service get_student_by_email_id(email) { return this.fire_store .collection('User', (ref) => ref.where('email', '==', email)) .valueChanges(); } 回答1: Ok, if you're getting

How to subscribe array of Observable Forkjoin not working

喜欢而已 提交于 2020-12-13 03:40:48
问题 I am trying to do multiple HTTP requests in angular using forkjoin.But when I subscribe to Observable it doest not give any response. let data = this.email.map((email) => this.get_student_service.get_student_by_email_id(email) ); forkJoin([data]).subscribe((res) => { console.log(res); }); console.log('Execute'); Here is my service get_student_by_email_id(email) { return this.fire_store .collection('User', (ref) => ref.where('email', '==', email)) .valueChanges(); } 回答1: Ok, if you're getting

How to subscribe array of Observable Forkjoin not working

耗尽温柔 提交于 2020-12-13 03:40:24
问题 I am trying to do multiple HTTP requests in angular using forkjoin.But when I subscribe to Observable it doest not give any response. let data = this.email.map((email) => this.get_student_service.get_student_by_email_id(email) ); forkJoin([data]).subscribe((res) => { console.log(res); }); console.log('Execute'); Here is my service get_student_by_email_id(email) { return this.fire_store .collection('User', (ref) => ref.where('email', '==', email)) .valueChanges(); } 回答1: Ok, if you're getting