System Information
-
Strapi Version: 3.6.1
-
Operating System: macOS
-
Database: PostgreSQL
-
Node Version: 14.16.1
-
NPM Version: 6.14.12
-
Yarn Version:
Hello to everyone!
I was trying to get data whose values match; I’d like to share dummy data to figure out what I want to achieve;
Let’s say the collection is teams, and in each team, I’ve tags field and each tag has id and content. If the tag content is = “art” I want to fetch the team that matched.
I tried to do it using “contains” and “in”. But this doesn’t give the desired result. After spending hours on this, it would be great if someone could help me.
Thanks in advance
Try the query below
localhost:1337/teams?_where[_or][0][tags.content_contains]=art
also, are you using the default controllers?
hope this helps
1 Like
Yes, I’m using default controllers but it did not work again @Twistedseed
Tags is a component that has included content, I think that’s why the problem occurs…
@michael1 Any help on the above issue? Facing the same issue as I have Content type with DZ containing components. Trying to render records using the component name/uid with in DZ.
Thanks in advance
@michael1 Have you got any solution ?
filters[arrayname][objectfieldname][$in]=value to search
You can checkout this post that covers populate and filtering with examples. Demystifying Strapi's Populated & Filtering