Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

353
Views
How can I get the firestore data with a date range, boolean, and not equals?

I have these sessions and I wanted to retrieve the data of these users with:

session1 == true
session2 == false

and also get the data of those that did not choose meeting2 or selected !== meeting2:

This is the firestore document: enter image description here

And how can I query it where DateEnd is greater than the date of today .

This is how I query it in firestore. So far, it isn't working.

componentDidMount() {
    firestore
      .collection("users")
      .where("aptment.session2", "==", false)
      .where("aptment.selection", "!=", "meeting2")
       //DateEnd greater than today's date
      .get()
      .then((snapshot) => {
        const users = [];
        snapshot.forEach((doc) => {
          const data = doc.data();
          users.push({
            "User ID": doc.id, 
            Address: data.address,
          });
        });
        this.setState({ users: users });
      })
      .catch((error) => console.log(error));
  }
 
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

From the Firebase documentation on query limitations:

In a compound query, range (<, <=, >, >=) and not equals (!=, not-in) comparisons must all filter on the same field.

So you can't have a >= condition on the DateEnd field when you already have a != condition on the aptment.selection field. You will have to do one of these condition in the query, and then perform the rest of the filtering in your application code.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!