I want to get all the jobs that Grade value New/Near New inside the job.
job->container->grade Equal to New/Near New.
-
Have you checked? Firestore - Nested queryDharmaraj– Dharmaraj2021-08-24 07:41:58 +00:00Commented Aug 24, 2021 at 7:41
-
What programming language are you using? Please respond with @AlexMamoAlex Mamo– Alex Mamo2021-08-24 07:42:42 +00:00Commented Aug 24, 2021 at 7:42
-
@AlexMamo i am using react JSJeewantha– Jeewantha2021-08-24 07:51:00 +00:00Commented Aug 24, 2021 at 7:51
Add a comment
|
1 Answer
To get all jobs with a grade value of New/Near New, you can use a query like this:
// Create a reference to the jobs collection
var collectionRef = db.collection("jobs");
// Create a query against the collection.
var query = collectionRef.where("container.grade", "==", "New/Near New");
And then you execute the query as also shown in the docs.
1 Comment
Jeewantha
You saved me @Frank . I also want to know about how to set multiple filters inside the where clause programmatically or dynamically. I am using react js i want to set multiple where clauses depend on user input. eg: 1st case User want to filter Status and Created time same time, 2nd case User want to filter status, Created time, Grade same time. How to set Filters depend on user selection>
