I want to find the highest value in a specific column of a specific table. It should be very simple. this is the documentation of LB4 https://loopback.io/doc/en/lb2/Where-filter But I didn't find it there.
Within the Loopback Filter Documentation they do mention a way to achieve this, even though it's not as obvious.
/weapons?filter[where][effectiveRange][gt]=900&filter[limit]=3
Essentially you can do the following:
gt
operator to set a min numberorder
if you wanted to ensure the sorting order is as expected.Here is a code example:
Employees.find({
where: {
age: {
gt: 1
}
},
order: 'age ASC',
limit: 1
})
Please let me know if this is what you were going for or if you need some more support.