How to Accomplish Where in Query in Cloud Firestore

IN query in cloud firestore

This is not possible with Firestore alone. It's not a text search engine. You will want to export your data to a text search engine such as Algolia in order to perform text searches that are not based on simple text equality. The documentation suggests this solution.

How to Perform SQL Select in Cloud Firestore?

You cannot perform the "select" you know from SQL in Cloud Firestore.

You will always retrieve full documents from Cloud Firestore queries. You will have to access your value from the data of the document snapshots.

This is also the reason why you should not store data you do not need from a fetch in documents but store that in sub collections.

Angular firestore perform another query from previous query

You could do something like this using rxjs:

let allUsers$ = this._afs.collection('firebase-user-table').valueChanges();

let adminUsers$ = allUsers$.pipe(
map((users) => users.filter(user)) => user.is_admin)
)

Then subscribe to each observable as needed



Related Topics



Leave a reply



Submit