google-cloud-firestore

Angular and Firestore: FirebaseError: Missing or insufficient permissions. How add idToken while observing a specific document

余生长醉 提交于 2020-05-16 22:05:33
问题 I code the code bellow that is notified in real time manner. I mean it keeps observing and soon any collection fields are updated it is loaded in Angular page. app.component.ts import { Component } from '@angular/core'; import { Observable } from 'rxjs'; import { AngularFirestore } from '@angular/fire/firestore'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) export class AppComponent { public transfers: Observable<any[]>; constructor(db: AngularFirestore) { this

Error Cloud Firestore addEventListener is not a function #react-native #firestore

帅比萌擦擦* 提交于 2020-05-16 22:05:31
问题 I have problems and errors when using cloud firestore That error appears when I type var db = firebaseApp.firestore () Image depicting errors import React, { Component } from 'react' import { StyleSheet, View, Dimensions, Image, Text, SafeAreaView, ScrollView, FlatList, Modal, TextInput, TouchableOpacity } from 'react- native'; import { firebaseAppKeep } from '../../constant/configFireBase' import FontAwesome5 from 'react-native-vector-icons/FontAwesome5' import TaskList from '../..

How to store data of collection from firestore into a list?

这一生的挚爱 提交于 2020-05-16 22:00:16
问题 I am looking to store fetch data from firestore into a List which would contain data from all of its documents. I defined list as : List retrievedData = List(); next, on press of button, I wanted to print data in all documents of a specific collection. So, I did this: RaisedButton( onPressed: () async { var collectionReferece = await Firestore.instance.collection('insults'); collectionReferece.getDocuments().then((collectionSnapshot){ retrievedData = collectionSnapshot.documents.toList(); });

Get document id From Firestore Swift

假装没事ソ 提交于 2020-05-16 21:59:52
问题 I am trying to get the document id from Firestore by executing a query like this:- func updateStatusInFirestore() { let orderid = saleOrder.first?.Orderid ?? "" print(orderid) let settings = db.settings settings.areTimestampsInSnapshotsEnabled = true db.settings = settings self.db.collection("SaleOrders").whereField("orderid", isEqualTo: "\(orderid)").getDocuments { (snapshot, err) in if let err = err { print("Error getting documents: \(err)") } else { for document in snapshot!.documents {

Get document id From Firestore Swift

为君一笑 提交于 2020-05-16 21:55:12
问题 I am trying to get the document id from Firestore by executing a query like this:- func updateStatusInFirestore() { let orderid = saleOrder.first?.Orderid ?? "" print(orderid) let settings = db.settings settings.areTimestampsInSnapshotsEnabled = true db.settings = settings self.db.collection("SaleOrders").whereField("orderid", isEqualTo: "\(orderid)").getDocuments { (snapshot, err) in if let err = err { print("Error getting documents: \(err)") } else { for document in snapshot!.documents {

Firestore collection query as stream in flutter

纵饮孤独 提交于 2020-05-16 13:56:04
问题 I'm trying to query a few documents from a collection, this query should listen to changes made in the queried documents, so I'd need a stream. I'm doing following (in Dart/Flutter) Stream<List<MatchRequest>> _getNewMatches() { return Collection<MatchRequest>(path: 'requests') .ref .where('status', isNull: true) .where('users', arrayContains: ['$currentUid']) .orderBy('last_activity') .snapshots() .map((list) => list.documents.map( (doc) => Global.models[MatchRequest](doc.data) as

Firestore collection query as stream in flutter

笑着哭i 提交于 2020-05-16 13:55:29
问题 I'm trying to query a few documents from a collection, this query should listen to changes made in the queried documents, so I'd need a stream. I'm doing following (in Dart/Flutter) Stream<List<MatchRequest>> _getNewMatches() { return Collection<MatchRequest>(path: 'requests') .ref .where('status', isNull: true) .where('users', arrayContains: ['$currentUid']) .orderBy('last_activity') .snapshots() .map((list) => list.documents.map( (doc) => Global.models[MatchRequest](doc.data) as

How do import data from cloud firestore to the local emulator?

主宰稳场 提交于 2020-05-16 13:55:26
问题 I want to be able to run cloud functions locally and debug against a copy from the production data. Is there a way to copy the data that is online to the local firestore emulator? 回答1: You can use the firestore-backup-restore to export and import your production data as JSON files. I wrote a quick hack to allow for importing these JSON in the Firebase Simulator Firestore instance. I proposed a pull request and made this npm module in the meantime. You can use it this way: const

Firestore collection query as stream in flutter

若如初见. 提交于 2020-05-16 13:55:16
问题 I'm trying to query a few documents from a collection, this query should listen to changes made in the queried documents, so I'd need a stream. I'm doing following (in Dart/Flutter) Stream<List<MatchRequest>> _getNewMatches() { return Collection<MatchRequest>(path: 'requests') .ref .where('status', isNull: true) .where('users', arrayContains: ['$currentUid']) .orderBy('last_activity') .snapshots() .map((list) => list.documents.map( (doc) => Global.models[MatchRequest](doc.data) as

Firestore collection query as stream in flutter

邮差的信 提交于 2020-05-16 13:54:39
问题 I'm trying to query a few documents from a collection, this query should listen to changes made in the queried documents, so I'd need a stream. I'm doing following (in Dart/Flutter) Stream<List<MatchRequest>> _getNewMatches() { return Collection<MatchRequest>(path: 'requests') .ref .where('status', isNull: true) .where('users', arrayContains: ['$currentUid']) .orderBy('last_activity') .snapshots() .map((list) => list.documents.map( (doc) => Global.models[MatchRequest](doc.data) as