Code Monkey home page Code Monkey logo

Comments (7)

pwizla avatar pwizla commented on July 17, 2024 1

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.

netzpixel avatar netzpixel commented on July 17, 2024 1

Thanks for your effort, I will test in the near future.

from documentation.

pwizla avatar pwizla commented on July 17, 2024

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.

netzpixel avatar netzpixel commented on July 17, 2024

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.

pwizla avatar pwizla commented on July 17, 2024

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.

pwizla avatar pwizla commented on July 17, 2024

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.

pwizla avatar pwizla commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.