I have document in Firestore that has “from” and “to” fields.
I want to find all documents that are touching the given range
for example:
Doc 1
from: 2
to: 4
Doc 2
from: 4
to: 8
Doc 3
from: 7
to: 10
Doc 4
from: 3
to: 5
Doc 5
from: 1
to: 2
Range
from: 3
to: 6
So the result is: Doc 1, Doc 2, Doc 4
Is there any way to do this in Firestore? I’ve provided the image for better understanding
I’ve tried this code
.where('from', '>=', 3)
.where('to', '<=', 6)
But the problem is, if one of the conditions is not fulfilled, then the document will not included