System Information
- Strapi Version: 3.6
- Database: Mongo
Hi, I’m trying to filter my products by location and delivery.
I have products who have fields lat, lng (latitude and longitude) and delivery.
It looks like :
product:{
title:'My product',
lat:48.6789,
lng:2.3455,
delivery:true
}
When a user search products by location I use the lat and lng of the user’s address to compare those values with lat and lng of my products.
I would like to add the delivery filter too, because I want get all products of the user location AND all the products with delivery but not necessarily inside the user location
It should do something like this :
ctx.query = {
lat_lte: UserGreaterLatitude,
lat_gte: UserLowerLatitude,
lng_lte: UserGreaterLongitude,
lng_gte: UserLowerLongitude,
delivery:true
}
await strapi.services.product.find(ctx.query)
But it doesn’t works
How can I do this ?