google-cloud-firestore

get object for all my documents in Cloud Firestore

↘锁芯ラ 提交于 2020-07-09 19:56:30
问题 I want to send a JSON of all my docuements in Firestore from my backend created with express The Firestore docs says how to get all documents but the method is with forEach and express can send only once the response. So the problem is that I don't know how to render all forEach in a variable to send once for the headers This is the code of Firestore docs: db.collection('users').get() .then((snapshot) => { snapshot.forEach((doc) => { console.log(doc.id, '=>', doc.data()); }); }) .catch((err)

get object for all my documents in Cloud Firestore

↘锁芯ラ 提交于 2020-07-09 19:55:01
问题 I want to send a JSON of all my docuements in Firestore from my backend created with express The Firestore docs says how to get all documents but the method is with forEach and express can send only once the response. So the problem is that I don't know how to render all forEach in a variable to send once for the headers This is the code of Firestore docs: db.collection('users').get() .then((snapshot) => { snapshot.forEach((doc) => { console.log(doc.id, '=>', doc.data()); }); }) .catch((err)

object is not a function when calling `useFirestoreConnect`

那年仲夏 提交于 2020-07-09 14:49:46
问题 I'm using react-redux-firebase and redux-firestore packages. I'm trying to connect firestore to redux using the useFirestoreConnect hook, but after calling this hook it gives me a TypeError like in this picture. I've searched in the GitHub issues, docs and here but I'vent fount any solution. The error: Uncaught (in promise) TypeError: Object(...) is not a function you see the whole error in this picture: The console.log error The TypeError returned 回答1: Hello guys I figure out where the

Firestore pagination last visible document throws out of bound exception

一个人想着一个人 提交于 2020-07-09 12:09:05
问题 Have tried to use Firestore pagination by using these links https://stackoverflow.com/a/50742175/4232013 but i facing a ArrayIndexOutOfBoundsException suddenly after some added documents in collection can any one help me to point out where i am making a mistake thanks. My code: private int limit = 2; private int PostLimit = 1; private void GettingFollowingList() { followingList = new ArrayList<>(); String UserID = FirebaseAuth.getInstance().getUid(); followingList.add(UserID);

Firestore pagination last visible document throws out of bound exception

纵然是瞬间 提交于 2020-07-09 12:07:13
问题 Have tried to use Firestore pagination by using these links https://stackoverflow.com/a/50742175/4232013 but i facing a ArrayIndexOutOfBoundsException suddenly after some added documents in collection can any one help me to point out where i am making a mistake thanks. My code: private int limit = 2; private int PostLimit = 1; private void GettingFollowingList() { followingList = new ArrayList<>(); String UserID = FirebaseAuth.getInstance().getUid(); followingList.add(UserID);

how can i remove data in array from firebase by React native?

时光总嘲笑我的痴心妄想 提交于 2020-07-09 11:46:57
问题 I'm making SNS app with React Native & Firebase. I can create a comments in array of each Post, and show it as a Flatlist. But I don't know how to remove each comment. Please let me know where to check the document or link. Or give me a hint. (In fact, it's been stuck here for almost two weeks.) ----action/post export const getComments = (post) => { return (dispatch) => { dispatch({ type: "GET_COMMENTS", payload: orderBy(post.comments, "date", "desc"), }); }; }; export const addComment =

how can i remove data in array from firebase by React native?

梦想的初衷 提交于 2020-07-09 11:46:29
问题 I'm making SNS app with React Native & Firebase. I can create a comments in array of each Post, and show it as a Flatlist. But I don't know how to remove each comment. Please let me know where to check the document or link. Or give me a hint. (In fact, it's been stuck here for almost two weeks.) ----action/post export const getComments = (post) => { return (dispatch) => { dispatch({ type: "GET_COMMENTS", payload: orderBy(post.comments, "date", "desc"), }); }; }; export const addComment =

Firestore doesn't store two identical values while updating an array

做~自己de王妃 提交于 2020-07-09 05:45:10
问题 Using flutter, when updating an array with 2 or more consecutive identical values, firestore only adds one. Example : void updateValue() { var now = [new DateTime.now()]; int pain =5; Firestore.instance.collection('Patient').document('bC2ML7LaQ1fWGOl37ZUq').collection('Symptom').document('2H6e99Bvrz6h0HBzgnyg') .updateData({ 'nauseaLevel' : FieldValue.arrayUnion([pain]), 'nauseaTime':FieldValue.arrayUnion(now)}); } When executing this function 2 times, the array "nauseaLevel" in firestore

Firebase “Parcelable encountered IOException writing serializable object” with object containing ArrayList of DocumentReference

馋奶兔 提交于 2020-07-08 11:45:53
问题 I'm trying to pass to another activity a User object containing an Arraylist of Firestore DocumentReference and when I start the activity I got this exception. I'm not using Parceleable so can you confirm that this error is due to the complexity of the object to pass and I must absolutely use the Parcels instead of simple Serializeable? Thanks for your help 回答1: You get that error because DocumentReference class does not implement Parceleable nor Serializable . If you need to serialize a

Firebase querying by date not working after deploy

﹥>﹥吖頭↗ 提交于 2020-07-08 03:24:18
问题 I'm working on a REST API with firebase and I'm querying some data by date. It works fine on the localhost but after deploy, it does not! I'm also using momentjs to help to deal with dates. The date field of my document is a timestamp. Here is how I'm doing my query: const documents = await admin.firestore() .collection('orders') .where('date', '>', moment('2020-06-23')) .where('date', '<', moment('2020-06-24')) .get() I have also done the same thing with Date() instead of momentjs const