Skip to main content

All Questions

Filter by
Sorted by
Tagged with
145 votes
14 answers
280k views

Getting all documents from one collection in Firestore

Hi I'm starting with javascript and react-native and I'm trying to figure out this problem for hours now. Can someone explain me how to get all the documents from firestore collection ? I have been ...
Stroi's user avatar
  • 1,881
66 votes
12 answers
33k views

Is there a workaround for the Firebase Query "IN" Limit to 10?

I have a query for firebase that has an array of IDs that has a size > 10. Firebase has restrictions on the number of records to query in one session. Is there a way to query against more than 10 at a ...
Olivia's user avatar
  • 2,033
49 votes
5 answers
36k views

How to add multiple docs to a collection in firebase?

Im working with React native and react-native-firebase My objective is to add multiple docs(objects) to a collection at once. Currently, I have this: const array = [ { name: 'a' },{ ...
Kolby Watson's user avatar
32 votes
6 answers
12k views

firebase firestore adding new document inside a transaction - transaction.add is not a function

I was assuming that it was possible to do something like: transaction.add(collectionRef,{ uid: userId, name: name, fsTimestamp: firebase.firestore.Timestamp.now(), }); But apparently it is not:...
honor's user avatar
  • 7,808
28 votes
5 answers
37k views

Is possible to call async function without await keyword? and what happens if we call without await?

I would like to do the following and keep in mind it actually works for me. my question is what happens and Is possible to call async usrs() func from non async componentDidMount() func? if it is not ...
Iqbal Jan's user avatar
  • 694
19 votes
4 answers
8k views

What's the difference between Firebase JavaScript SDK and react-native-firebase

I am trying to use to use Firebase (Cloud Firestore) for a react-native app, to store my JSON objects. I ve seen people using Firebase in their apps (npm install firebase), and others using react-...
kernelman's user avatar
  • 1,022
17 votes
2 answers
13k views

What is the best practice of firestore data structure?

I'm making a blog app using firebase. I want to know the best practice of data structure. As far as I know, there are 2 case. (I'm using react native) case 1: posts -postID -title,content,...
yn1043's user avatar
  • 568
16 votes
3 answers
7k views

Can't get data from React-Native-Firebase(v6) Firestore: undefined is not a function (near '...this._firestore.native.collectionGet...')

I've been stuck on this issue for so long. I just started implementing Firestore in my react-native application with react-native-firebase. I'm just following the docs [https://invertase.io/oss/react-...
Akshat Jain's user avatar
16 votes
2 answers
11k views

How to use array-contains operator with an array of objects in Firestore?

So, i want to query some data from firestore. this is my data structure so, the collection is Modules, then i now have 2 documents but it will be 75 or something. Then in that document i want to get ...
Sander van Maastricht's user avatar
16 votes
2 answers
24k views

How do I link auth users to collection in Firestore?

I'm trying to connect a user to the user collection in firestore. I'm using cloud functions, but I don't think I'm implementing it correctly. firebase.auth().createUserWithEmailAndPassword(email, ...
Rachele Avella's user avatar
15 votes
1 answer
9k views

Arrays vs. Maps vs. Subcollections for a set of Objects on Cloud Firestore

I am developing a mobile app in React-Native. Data is stored on Cloud Firestore. I have a question regarding the best way of structuring the data on Cloud Firestore. The list of contacts, which every ...
Bilal Abdeen's user avatar
  • 1,867
14 votes
5 answers
17k views

Could not reach Cloud Firestore backend - React native Firebase v9

I saw many questions on SO regarding this issue and none of them was answered (or the solution doesn't work), I don't know why. People are having this error continuously but no solution is being ...
dev1ce's user avatar
  • 1,659
13 votes
2 answers
50k views

How to get sub-collections with Firebase firestore? [duplicate]

I am tying to get all the collections withing the withing the document, I don't know how to do it I am new to firestore. Firebase.firestore() .collection("reservations") .doc(tripUid) ...
Anes Abismail's user avatar
12 votes
9 answers
14k views

React Native to firestore: Firestore (8.2.1): Connection WebChannel transport errored

I have created simple React Native screen which can store data to firestore. I have tried below code but it did not work rather than throw some error. anyone can help me out? My Code: App.js import ...
Elavarasan r's user avatar
  • 1,235
12 votes
7 answers
3k views

In react native app (through Expo) using firestore permissions - request.auth is always null

Here's my code: firebase.auth().onAuthStateChanged((user) => { if (user) { console.log("We are authenticated now!"); firebase.firestore().collection("users") .doc(...
Ronen Rabinovici's user avatar
11 votes
2 answers
28k views

Getting 'firestore/permission-denied' while integrating firestore in React native mobile app

I'm trying to firestore documents through react native app, but facing the following issue Here is the code constructor() { super(); this.ref = firebase.firestore().collection('todos'); }...
Afsara's user avatar
  • 1,441
10 votes
4 answers
13k views

firestore Error: Argument "documentPath" must point to a document

I build react native app with firebase/firestore and I get the error Error: Argument "documentPath" must point to a document. when I write this line var userStatusFirestoreRef = firebase....
Manspof's user avatar
  • 227
10 votes
1 answer
3k views

Enabling Firestore Persistence for React Native

I am using React Native Firebase and I am trying to enable persistence for my app. On my Android onCreate: public void onCreate() { super.onCreate(); FirebaseDatabase.getInstance()....
Undefined's user avatar
  • 764
9 votes
1 answer
4k views

Firebase Firestore missing or insufficient permissions using Expo (React Native)

I've been using FireStore for a project that works fine in the browser, but when I port the code to Expo, running on a iOS 11.2 iPhone X in the simulator, it keeps raising Error: Missing or ...
raphaeltm's user avatar
  • 817
8 votes
5 answers
10k views

Firebase firestore timestamp to Formatted Date

I am working on a firebase project and for displaying time regarding and entity, what i got is the timestamp. I am working on a react native project. How to convert the received timestamp to properly ...
FortuneCookie's user avatar
7 votes
2 answers
8k views

redux-persist/createPersistoid: error serializing state TypeError: Converting circular structure to JSON

I am trying to integrate redux-persist to my react-native project. The aim is to persist the redux store's data between application re-launch so that user does not need to log in each time they launch ...
honor's user avatar
  • 7,808
7 votes
2 answers
5k views

Unable to fetch data from Firebase Firestore in react native

I am trying to GET data from Firestore but I cannot see data coming. I am building a react-native app. I am using react-native-firebase. I also tried Transactions method from react-native-firebase ...
Saumay Paul's user avatar
7 votes
4 answers
2k views

Firebase Firestore Emulator UI is not showing any data, but data is being returned in app query

I am facing an odd issue with firebase's firestore emulator. When i start the emulator, and check the emulator's firestore UI, it shows that no data exists in the db yet. Then, i try query the ...
Eli Himself's user avatar
7 votes
2 answers
3k views

Firestore query comparing two arrays without array-contains

Is it possible to compare two arrays in a Firestore query without 'array-contains'? Something like this: query = query.where( "info.currentLocation", "==", ...
Olivia's user avatar
  • 2,033
7 votes
0 answers
380 views

Fetch firebase remote config values on first login

I'm trying to fetch remote config values on first login (and not only after minimumFetchIntervalMillis expires), this is what i do (pseudo): yield firebaseConfig.setConfigSettings(15 mins) yield ...
Itzik984's user avatar
  • 16.5k
6 votes
1 answer
857 views

Firestore add method does not work properly when I am offline

If I run the following line of code when my device is offline, The card will be added to local cache. But the application never goes to the next line. const data = await firebase.firestore()....
a.toraby's user avatar
  • 3,352
6 votes
3 answers
11k views

Error: Text strings must be rendered within a <Text> component in React Native when string is not empty

so I have recently ran into the error show in the text tag, although I can not find why it is showing. I have logged that the value is not empty and that the value exists before I press the button. ...
CSStudent123456's user avatar
6 votes
1 answer
1k views

Firebase web vs ios and android version for react native project

I'm new to app development and this has been confusing me. I have a project created in react-native that I want to be available for both android and iOS. I've watched a few tutorials on how to create ...
ben291291's user avatar
6 votes
1 answer
12k views

How to get all of the collection ids from document on Firestore? [duplicate]

I connect the database from React Native project. In my Firestore database Buildings/Taipei, i want to get all of the collection ids like 201 202 203 I try to use the code: const db = firebaseApp....
Morton's user avatar
  • 5,650
6 votes
3 answers
4k views

could not reach cloud firestore backend with firestore emulator on android emulator

My problem is that I'm unable to call firestore from the client using the firebase firestore emulator on Android emulators. I've tested multiple Android emulators. The error I'm getting suggests the ...
Gwater17's user avatar
  • 2,224
6 votes
3 answers
1k views

Unable to add or retrieve results

I am using firebase web SDK, as my project is still on expo I can't seem to add or get any results from firestore. No error is thrown, nothing is shown, nothing is saved also. import * as firebase ...
fweffort's user avatar
6 votes
3 answers
19k views

Firebase Firestore collection retrieval in React Native

I'm building a React Native app with Expo using the Firebase web api and trying to retrieve a collection of documents from my Firestore project. According to the documentation over at https://firebase....
Pip's user avatar
  • 182
6 votes
1 answer
2k views

How to pass extra auth parameters for firestore rules authentication (React-Native)?

I want to implement role based restrictions in my application. I have the user role information in one collection documents. Now I want to write rules to restrict different Write, Update operation on ...
Hriday Modi's user avatar
  • 2,071
6 votes
2 answers
1k views

onSnapshot appears to stop working after a period of time

I am using firestore onSnapshot methods in a React Native app on several different sets of data in my app, and for the most part they all appear to work fine. However, after a period of time, perhaps ...
Matt Ormrod's user avatar
6 votes
1 answer
613 views

Handling Async Await to use Firebase with react native

const userID = firebase.auth().currentUser.uid const checkRoomExists = async ()=>{ var queryRef = firestore.collection("groups"); try{ console.log("userId: "+userID) ...
boriii's user avatar
  • 87
6 votes
0 answers
2k views

@firebase/firestore: Firestore (7.6.0): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds

I am working on a React native project that is connected to cloud firestore and I am using the latest version of Firebase package ^7.6.1, My Application is target both Android and iOS I tested the ...
Ahmed Saeed's user avatar
6 votes
1 answer
2k views

Deleting documents in Firestore not updating onSnapshot

I am fetching a list of items from firestore in react native. If an item document is updated, my list refreshes as expected through onSnapshot. But if the document is deleted, my list does not ...
T_R_U_T_H's user avatar
  • 475
6 votes
1 answer
6k views

Firebase firestore how to get reference data without additional request?

When I have fetched places that we can see in screenshot below, I need get their data, but it's reference to data, I can get the data without additional request like place.ref.data()? If I have 30 ...
Andrey Shostik's user avatar
5 votes
1 answer
2k views

Do firestore batch writes get re-run automatically on failure?

While going through the official documentation I found out that transactions are automatically re-run a finite number of times by the SDK on failure, however in case of Batch Writes it is not ...
Maaz Bin Khawar's user avatar
5 votes
2 answers
3k views

Can I add days to a Cloud Firestore server timestamp?

I am writing a React Native app that creates a coupon for a user that has a date created field as well as date expires in Firestore. The date expired is the date created plus some days (e.g 7) ...
jquartz's user avatar
  • 63
5 votes
2 answers
17k views

correct way to use firestore onSnapShot with react redux

I'm trying to figure out the correct way to use firestore.onSnapshot with react-redux. I currently have this code in my action file, which I am calling on componentWillMount() in my component. ...
Jakob's user avatar
  • 4,844
5 votes
1 answer
2k views

expo push notifications using firebase cloud functions in react native

Seeing this tutorial on https://www.youtube.com/watch?v=R2D6J10fhA4, I am trying to implement Send Push Notifications ( Expo + Firebase Cloud Functions) I'm trying to write a cloud function that will ...
user8398107's user avatar
5 votes
1 answer
136 views

Get fullData when CollectionGroup is found

I have a problem querying all data from 1 collection User-> UidUser-> InfoUser (POST (Collection), name, age ...) I then used the code below to get the collectionsGroup (Post) but how do I get ...
Thắng Trương Khắc's user avatar
5 votes
1 answer
655 views

React-Native: Unable to add or set() document using firestore when app is Offline(no internet access)

I'm facing an issue while using .set() function in offline mode for creating a document in firestore. But .update() , .get() and .delete() functions are working in offline mode. below is the code ...
Rakshith D's user avatar
5 votes
2 answers
498 views

How to combine two Redux Firebase Cloud Firestore queries?

I have two redux queries that pull posts from my Firebase Firestore. The first successfully displays all of the posts of the people I'm following: export function fetchUsersFollowingPosts(uid) { ...
Tom Wicks's user avatar
  • 925
5 votes
2 answers
511 views

Should I build a local data layer/app state to maintain state in a React Native/Firestore App?

A main selling point of Firestore is the ability to use it as a online/offline source of truth. I'm using it in this way right now: updating the Firestore document directly on an action, then ...
learningAngular's user avatar
5 votes
1 answer
2k views

Does react-native-firebase package handle the "Setting a timer for a long period of time is a performance and correctness issue" warning?

I have been getting a lot of these yellow warnings in my app. Especially in parts of the code where I use firebase/firestore SDK: Setting a timer for a long period of time, i.e. multiple minutes, is ...
honor's user avatar
  • 7,808
5 votes
0 answers
1k views

Firestore - slow optimistic updates?

Optimistic updates do not seem to work as fast expected in Firestore. I am seeing update times at a minimum of 200 ms, in between the time I write to Firestore and the time my snapshot listeners get ...
Scottmas's user avatar
  • 1,148
5 votes
0 answers
2k views

How to set up multiple onSnapshot() listeners at once

I am using the react-native-firebase ^3.1.1 and react-native ^0.49.5. A user of my application has variable permissions to territories. For example, User A may have permission to just territory 1, ...
quirky purple's user avatar
4 votes
2 answers
15k views

how to add document to firestore database using react native

We are trying add documents values manually using react native app to firestore DB. Here is the reference code we found for web db.collection("cities").doc("LA").set({ name: "Los Angeles", ...
Afsara's user avatar
  • 1,441

1
2 3 4 5
34