google-cloud-firestore

Firestore Group by field

限于喜欢 提交于 2020-07-30 12:51:10
问题 Below is my firestore collection structure My vue method to get data fetchResults(){ db.collection('data').onSnapshot((querySnapShot)=>{ let results = []; querySnapShot.forEach(doc=>{ results.push(doc.data()) }) this.record=results; }) } What I want is to query in the document like group by ID and order by sec_id desc . How do I suppose to query like that? So that I will get document grouped by ID field. 回答1: As a NoSQL type database, Cloud Firestore doesn't offer any aggregation queries such

Firestore Deadline Exceeded Node

五迷三道 提交于 2020-07-30 10:22:29
问题 I would like to load collection that is ~30k records. I.e load it via. const db = admin.firestore(); let documentsArray: Array<{}> = []; db.collection(collection) .get() .then(snap => { snap.forEach(doc => { documentsArray.push(doc); }); }) .catch(err => console.log(err)); This will always throw Deadline Exceeded error. I have searched for some sorts of mechanism that will allow me to paginate trough it but I find it unbelievable not to be able to query for not that big amount in one go. I

Firestore Deadline Exceeded Node

孤街醉人 提交于 2020-07-30 10:21:12
问题 I would like to load collection that is ~30k records. I.e load it via. const db = admin.firestore(); let documentsArray: Array<{}> = []; db.collection(collection) .get() .then(snap => { snap.forEach(doc => { documentsArray.push(doc); }); }) .catch(err => console.log(err)); This will always throw Deadline Exceeded error. I have searched for some sorts of mechanism that will allow me to paginate trough it but I find it unbelievable not to be able to query for not that big amount in one go. I

Firestore Deadline Exceeded Node

旧巷老猫 提交于 2020-07-30 10:19:11
问题 I would like to load collection that is ~30k records. I.e load it via. const db = admin.firestore(); let documentsArray: Array<{}> = []; db.collection(collection) .get() .then(snap => { snap.forEach(doc => { documentsArray.push(doc); }); }) .catch(err => console.log(err)); This will always throw Deadline Exceeded error. I have searched for some sorts of mechanism that will allow me to paginate trough it but I find it unbelievable not to be able to query for not that big amount in one go. I

What is the difference between get() and valueChanges() in Angular Firestore query? [closed]

南楼画角 提交于 2020-07-30 08:24:20
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 10 months ago . Improve this question As the title says I would like to ask what is the difference (if there is any) between get() and valueChanges() when performing a query in Angular Firestore. Are there also any advantages/disadvantages between the two maybe regarding the reads/costs? 回答1:

What is the difference between get() and valueChanges() in Angular Firestore query? [closed]

大憨熊 提交于 2020-07-30 08:21:16
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 10 months ago . Improve this question As the title says I would like to ask what is the difference (if there is any) between get() and valueChanges() when performing a query in Angular Firestore. Are there also any advantages/disadvantages between the two maybe regarding the reads/costs? 回答1:

Unable to save the data from the textfields forms in the firebase

不羁岁月 提交于 2020-07-28 04:59:33
问题 I was trying to send an email and save the user input data to the firebase from the flutter application. My code does: I have created the application which is capable to send email but I have got stuck to save those text fields data in the firebase. I have implemented the cloud firestore in the code but I am getting quite a few errors. My code: import 'package:flutter/material.dart'; import 'dart:async'; import 'package:flutter_email_sender/flutter_email_sender.dart'; import 'package:cloud

Firebase Firestore: How to monitor read document count by collection?

浪子不回头ぞ 提交于 2020-07-27 03:30:15
问题 I'm monitoring document read count in Firebase Console > Firestore > Usage section. However, I want to find a way to see document read count by collection so that I can know which query to optimize. Is there anyway for that? I looked into GCP monitoring but I couldn't achieve what I want to do here. I read documents from js SDK and nodejs Admin SDK 回答1: Firestore provides no accounting other than a total running read count for the entire database for the last 30 days. If you need something

Firebase Firestore: How to monitor read document count by collection?

帅比萌擦擦* 提交于 2020-07-27 03:29:49
问题 I'm monitoring document read count in Firebase Console > Firestore > Usage section. However, I want to find a way to see document read count by collection so that I can know which query to optimize. Is there anyway for that? I looked into GCP monitoring but I couldn't achieve what I want to do here. I read documents from js SDK and nodejs Admin SDK 回答1: Firestore provides no accounting other than a total running read count for the entire database for the last 30 days. If you need something

Asynchronous Firebase query to response

一世执手 提交于 2020-07-23 08:36:06
问题 I'm trying to get all documents from a firebase collection, create a list and return it on request with a Cloud Function, but I'm struggling with the asynchronous nature of JavaScript. Here's my code so far: firebase.initializeApp(firebaseConfig); const db = firebase.firestore(); const items = ""; async function buildItems() { db.collection("reminders").get().then((QuerySnapshot) => { QuerySnapshot.forEach((item) => { items.concat("<li>" + item.data().name + "</li>"); console.log(items); });