0

I am trying to filter my list of data by integer value.... for example: between 1-10, but when i use <= and >= at the same time it is not taking returning data

db.collection('exapmle')
.where('lmv_capacity', '>=', this.min_capacity)
.where('lmv_capacity', '<=', this.max_capacity)
.get()
.then(res => {
  res.forEach((doc) => {
this.datas.push({
  id: doc.id,
  owner_name: doc.data().owner_name,
  locality: doc.data().locality,
  district: doc.data().district,
  landmark: doc.data().landmark,
  two_wheeler_capacity: doc.data().two_wheeler_capacity,
  lmv_capacity: doc.data().lmv_capacity
})
})
})
3
  • is it not suppose to be >= this.min_capacity and <= this.max_capacity Commented Nov 18, 2020 at 6:59
  • If you perform error handling on this query (you have none now) you will find an error message that says what the problem is. It's a limitaton of Firestore. I've marked duplicates that explain the issue. Commented Nov 18, 2020 at 7:11
  • can you please look at the updated edit again, it is not returning data if its on the same field also @DougStevenson Commented Nov 18, 2020 at 7:23

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.