google-cloud-firestore

How to order data from Firestore in Flutter, orderBy not ordering correct

匆匆过客 提交于 2020-02-29 04:54:05
问题 I'm building an app where the users can write into my db and ask questions to other users, like a doctor app. Where the doctors can answer the questions. I wanna order the questions by date, where I would like to order the questions by newest, and also the most popular. I try to order the newest by the following: date: "29 September 2019" Firestore.instance .collection("Questions") .orderBy("date", descending: true) // 1 will be last, 31 will be latest .snapshots(), But that seem not to work.

How to order data from Firestore in Flutter, orderBy not ordering correct

蹲街弑〆低调 提交于 2020-02-29 04:53:05
问题 I'm building an app where the users can write into my db and ask questions to other users, like a doctor app. Where the doctors can answer the questions. I wanna order the questions by date, where I would like to order the questions by newest, and also the most popular. I try to order the newest by the following: date: "29 September 2019" Firestore.instance .collection("Questions") .orderBy("date", descending: true) // 1 will be last, 31 will be latest .snapshots(), But that seem not to work.

How to paginate Cloud Firestore data with ReactJs

喜欢而已 提交于 2020-02-27 08:54:26
问题 I'm working with Firebase - Cloud Firestore and at the moment I would like to paginate all the records available. I already have a list of records and what is left is some pagination for this. I'm new with Cloud Firestore, so any clarity is appreciated. I checked the Firestore documentation (https://firebase.google.com/docs/firestore/query-data/query-cursors#paginate_a_query) and examples with ReactJS, but there is not much available. I understand that eg: .startAt(0), .limit(10) , but the

How to paginate Cloud Firestore data with ReactJs

家住魔仙堡 提交于 2020-02-27 08:54:06
问题 I'm working with Firebase - Cloud Firestore and at the moment I would like to paginate all the records available. I already have a list of records and what is left is some pagination for this. I'm new with Cloud Firestore, so any clarity is appreciated. I checked the Firestore documentation (https://firebase.google.com/docs/firestore/query-data/query-cursors#paginate_a_query) and examples with ReactJS, but there is not much available. I understand that eg: .startAt(0), .limit(10) , but the

How to change region of existing Firebase project?

孤街浪徒 提交于 2020-02-27 04:56:18
问题 I have a project that is located in the Central America region, but since I can choose a European region, I would like to change the location of the firestore and storage. Is it possible to do this without deleting the existing project? Updated Responce from technical support: Thank you for reaching out to us. Currently, once you select a location for your project, you cannot change it. You might find this documentation useful for additional information. https://firebase.google.com/docs

How to use Snapshot listener to get real time update in a recyclerview?

本小妞迷上赌 提交于 2020-02-27 03:50:06
问题 Below is the code I used to retrieve documents data in a recyclerview. It works fine. But whenever the new document is added, it does not update it in real time. I know snapshot listener is for that purpose only but having a hard time to get it work. Any help will be appreciated. :) mFirestore.collection("Users").get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() { @Override public void onComplete(@NonNull Task<QuerySnapshot> task) { if (task.isSuccessful()){ for

How to add data to Cloud Firestore?

泪湿孤枕 提交于 2020-02-26 03:22:10
问题 The problem is that data is not inserted. Here is the node.js code : const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(functions.config().firebase); var db = admin.firestore(); exports.signUp = functions.https.onCall((data, context) => { const uuid = data.uuid; const name = data.name; const gender = data.gender; const age = data.age; var docRef = db.collection('users').doc(uuid).set({ name: name, gender: gender, age: age, current

How to add data to Cloud Firestore?

烈酒焚心 提交于 2020-02-26 03:20:06
问题 The problem is that data is not inserted. Here is the node.js code : const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(functions.config().firebase); var db = admin.firestore(); exports.signUp = functions.https.onCall((data, context) => { const uuid = data.uuid; const name = data.name; const gender = data.gender; const age = data.age; var docRef = db.collection('users').doc(uuid).set({ name: name, gender: gender, age: age, current

Firestore query where field is not equal to value using indexes with onSnapshot

烂漫一生 提交于 2020-02-25 08:19:45
问题 I am trying to get all unseen messages that the current user has in conversation. The problem is that I do not know how to exclude other user seen messages and get only current user seen messages so I can do allMessages - allReadMessages = unread messages count This is my function that tries to achieve what I explained: //helper to get unread messages count async getUnseenMessagesCount(chatAuthor) { const collectionRef = (await firestore()).collection(this.collectionPath) try { collectionRef

How to prevent Firebase Firestore from unnecessary read operations in a Flutter app?

百般思念 提交于 2020-02-25 04:03:11
问题 So in my Firestore db, I have about 2000 documents that contain images (blob) with some tags to group them, order them and search them on local device. In my app, images are stored in a local SQLFlite db and user is able to see them offline, Firestore offline persistance is also enabled. When device network connection is on, firestore listener reads all my queries again because my app shows my images according to the tags that I use to classify images, even if there is no changes in my