# Fetch collection of resource that do have relationship established with another resource

**URL:** <https://discuss.jsonapi.org/t/fetch-collection-of-resource-that-do-have-relationship-established-with-another-resource/2891>\
**Category:** Uncategorized\
**Created:** [July 31, 2024, 5:34pm UTC](https://discuss.jsonapi.org/t/fetch-collection-of-resource-that-do-have-relationship-established-with-another-resource/2891 "2024-07-31T17:34:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rangolijain](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rangolijain](https://discuss.jsonapi.org/u/rangolijain)\
**Post date:** [July 31, 2024, 5:34pm UTC](https://discuss.jsonapi.org/t/fetch-collection-of-resource-that-do-have-relationship-established-with-another-resource/2891/1 "2024-07-31T17:34:47Z")

</div>

In a one-to-many relationship.  
When one resource can be associated to 0 or multiple other resource then if I have a requirement to fetch collection of resource that does not have the association established, then how would i do that?

---

<div class="post-metadata">

**Author:** ![bradjones1](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/bradjones1/32/879_2.png) [@bradjones1](https://discuss.jsonapi.org/u/bradjones1)\
**Post date:** [August 15, 2024, 2:15am UTC](https://discuss.jsonapi.org/t/fetch-collection-of-resource-that-do-have-relationship-established-with-another-resource/2891/2 "2024-08-15T02:15:59Z")

</div>

It’s a little unclear what you’re referring to, but if you’re talking about fetching a relationship. You’d return an empty array. See [JSON:API — Latest Specification (v1.1)](https://jsonapi.org/format/#fetching-relationships-responses-200)

---

<div class="post-metadata">

**Author:** ![jelhan](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/jelhan/32/822_2.png) [@jelhan](https://discuss.jsonapi.org/u/jelhan)\
**Post date:** [August 15, 2024, 8:56am UTC](https://discuss.jsonapi.org/t/fetch-collection-of-resource-that-do-have-relationship-established-with-another-resource/2891/3 "2024-08-15T08:56:25Z")

</div>

If you want to filter a collection to only request those, which have an empty relationship, you should use `filter` query parameter as with any other filtering.

The JSON:API specification os agnostic on your filter strategy. You are free to chose what ever syntax you prefer to encode that filter criteria as a query parameter.
