Comments (7)
Let me see if I can reproduce this with a fresh new project. I will create an events
collection type that features an address
component, with at least a lat
field, and see if I can filter entries based on the lat
value.
If it does not work, I will transfer this to the Strapi engineers.
If it does work, you would have to reach out to the plugin maintainer as 3rd-party plugins' code and documentation are not maitained by Strapi.
from documentation.
Thanks for your effort, I will test in the near future.
from documentation.
Hi @netzpixel!
First, I'm sorry you're having issues with your specific use case.
I expect to be able to filter within objects in all levels.
the documentation speaks about deep filtering
Bringing @derrickmehaffy to the conversation to double-check, but as our documentation states in the deep filtering section, you might need to populate some data, especially if it comes from relations, components, or dynamic zones which are not included by default.
To get data for something as deep as address > details > geometry > location > lat, I think your query should look more like: http://localhost:1337/api/events?filters[address][details][geometry][location][lat][$gte]=50
I encourage you to try our interactive query builder, which should help building complex queries such as filtering on both first-level (address.lat
) and deeply nested (address.lat.details.geometry.location.lat
) latitude data.
from documentation.
lat and lng are on the second level already so no need to go that deep, but still it doesn't work. I sadly always get back everything.
from documentation.
I've just tested it, @netzpixel.
I tried testing the strapi-location-field-plugin
but it seems it does not work properly with the latest (4.21.0) version of Strapi.
So, instead, as mentioned in the previous comment, I created a simple structure in the Content-Types Builder with:
- an 'Event' collection type
- which only uses an "address" component
- which itself only includes a "lat" field (number, float)
Depending on the data structure, you might need to populate some stuff (components, for instance) but I can confirm the filter works.
See attached video (screen capture, no sound, should be self-explanatory).
Screen.Recording.2024-03-26.at.18.06.20.mov
from documentation.
I would suggest you try various combinations depending on the data structure, and if it still does not work, as previously suggested, you should try to reach out the plugin maintainer.
To me this does not seem like a Strapi documentation issue (docs mention you might need to populate some data), so if you don't have any more questions, I will soon close the documentation issue.
from documentation.
I will now close this issue as it has been stale for 2 weeks. I hope your problem is now solved. If not, please feel free to reopen the issue.
from documentation.
Related Issues (20)
- [Request]: Adding mdw to >all< routes of one content type HOT 1
- Clarify that you need to use .ts files when extending plugins if you use TypeScript HOT 1
- Data transfer - Test the transfer command locally - instructions do not work
- wrong resolve path in example HOT 1
- DOCS: Complex filtering mentions fields which are not in the example
- DOCS: Deep filtering mentions fields which are not in the example
- [v5] defaultIndex is removed and not included in breaking changes HOT 2
- [Request]: Adding a guide on deploying Sprapi using cPanel HOT 6
- [Request]: HOT 1
- v5 documents completely change how lifecycles work, not documented as a breaking change HOT 13
- Get started Button is not redirecting to the docs HOT 3
- DOCS: EntintyService `findMany` returns Entry (not Entry[]) for singular types HOT 2
- Instructions on creating a middleware mention read but it probably should be find HOT 1
- entityService parameter documentation should include 'locale' HOT 1
- [Request]: How does strapi entity service work with transactions? HOT 1
- Default error classes confuse Unauthorized & Forbidden HOT 3
- [Request]: Typescript typings HOT 2
- [BUG] Missing notes about i18n plugin becoming core package HOT 3
- Swagger and openapi json files do not exists HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.