In my use-case, I have a Class, and this class has some columns. Each time that I want to query from this class, I need to filter results between a range of numbers.
I have a column named
yearFrom and another named
yearTo with the type of Number.
These columns behave like a range of years (2015 to 2020 for example!).
So I need to filter these using
lessThan if I’m right, based on docs.
And this is what my code looks like:
const yearAsNumber = 2020; const myQuery = new Parse.Query("MyClass"); myQuery.greaterThan("yearFrom", yearAsNumber); myQuery.lessThan("yearTo", yearAsNumber); const results = await myQuery.first();
But it’s not working at all! If I remove
lessThan, everything working right.
So I’m not sure what is the problem. I’m using it wrong, or it’s a miss understanding with the usage of these methods?