Skip to content

How to properly filter queries? #409

Answered by epodol
gugahoi asked this question in Q&A
Jul 24, 2021 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hi,

It seems like most of the code your writing is already done in ReactFire's useFirestoreCollectionData. I highly recommend using that unless you need some advanced customization or filtering of the data received (such as creating your own OR query). Unless you are using other features of reactfire besides useFirestore, you might as well just use the vanilla JS SDK, because that hook just returns Firestore (with maybe some suspense depending on your configuration).

The useFirestoreCollectionData acts as a react hook, which you would typically call inside a react component. As an argument for the useFirestoreCollectionData, you should supply the Firestore query. Whenever the argument for…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@gugahoi
Comment options

@epodol
Comment options

@jhuleatt
Comment options

Answer selected by gugahoi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants