# How can I filter within collection-link? e.g. filter\[collection.field\]=value

**URL:** <https://discourse.getcockpit.com/t/how-can-i-filter-within-collection-link-e-g-filter-collection-field-value/690>\
**Category:** Support\
**Created:** [March 28, 2019, 9:00pm UTC](https://discourse.getcockpit.com/t/how-can-i-filter-within-collection-link-e-g-filter-collection-field-value/690 "2019-03-28T21:00:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nuno.bento.b](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@nuno.bento.b](https://discourse.getcockpit.com/u/nuno.bento.b)\
**Post date:** [March 28, 2019, 9:00pm UTC](https://discourse.getcockpit.com/t/how-can-i-filter-within-collection-link-e-g-filter-collection-field-value/690/1 "2019-03-28T21:00:21Z")

</div>

I am trying to query with a relation on it. For example:  
…localhost/cockpit-master/api/collections/get/tags?token=4f317a928d33bce6851dbfff9287ca&filter[tag\_type.title]=Category

But it don’t work:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/1X/64c330ebd91f2aac9b8110d81f5536687af9d530.png)

But both of these works:

- …localhost/cockpit-master/api/collections/get/tag\_types?token=4f317a928d33bce6851dbfff9287ca&filter[title]=Category
- …localhost/cockpit-master/api/collections/get/tags?token=4f317a928d33bce6851dbfff9287ca&filter[level]=0

Here are some screenshots to help understand my setup:

- …imgur.com/ydpJNef
- …imgur.com/unNEIhP
- …imgur.com/QQDBfsN
- …imgur.com/WVo7InB
- …imgur.com/nMD9MD4  
(for some reason I cannot add more than 2 links on my post, so just add https:// to the links above)

Any idea why is not working? or what am I doing wrong?

Thanks!

---

<div class="post-metadata">

**Author:** ![serjoscha87](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/serjoscha87/32/151_2.png) [@serjoscha87](https://discourse.getcockpit.com/u/serjoscha87)\
**Post date:** [March 28, 2019, 10:31pm UTC](https://discourse.getcockpit.com/t/how-can-i-filter-within-collection-link-e-g-filter-collection-field-value/690/2 "2019-03-28T22:31:34Z")

</div>

if you are using the shipped sqlite backend (and no external DB like mongo) you are not able to filter by a collection link. The SQLite implementation uses [GitHub - agentejo/mongo-lite: Schemaless database on top of SQLite](https://github.com/agentejo/mongo-lite) which is not able to filter by field subsets

> [@](#):
>
> if you’re using mongodb as cockpits data source then this filter query should work:
> 
> `filter[telefono][value]=1111`
> 
> but if you’re using the default MongoLite data source then querying nested values isn’t supported, sorry.

– [Filtering on a collectionlink - #9 by serjoscha87](https://discourse.getcockpit.com/t/filtering-on-a-collectionlink/197/9)

---

<div class="post-metadata">

**Author:** ![nuno.bento.b](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@nuno.bento.b](https://discourse.getcockpit.com/u/nuno.bento.b)\
**Post date:** [March 28, 2019, 10:49pm UTC](https://discourse.getcockpit.com/t/how-can-i-filter-within-collection-link-e-g-filter-collection-field-value/690/3 "2019-03-28T22:49:08Z")

</div>

Hi @serjoscha87 I simply downloaded the .zip file and ran. How can I upgrade for mongodb?

---

<div class="post-metadata">

**Author:** ![nuno.bento.b](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@nuno.bento.b](https://discourse.getcockpit.com/u/nuno.bento.b)\
**Post date:** [March 28, 2019, 10:56pm UTC](https://discourse.getcockpit.com/t/how-can-i-filter-within-collection-link-e-g-filter-collection-field-value/690/4 "2019-03-28T22:56:45Z")

</div>

Wait I am actually a bit confused. Because I just tried in the demo this: [https://demo-api.directus.app/\_/items/sales?filter[member.first\_name][eq]=Osborn](https://demo-api.directus.app/_/items/sales?filter%5Bmember.first_name%5D%5Beq%5D=Osborn) at it worked!

The only setup I needed to do to the default demo was to give Read permissions to the Public user group (which I also done on my local)

---

<div class="post-metadata">

**Author:** ![serjoscha87](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/serjoscha87/32/151_2.png) [@serjoscha87](https://discourse.getcockpit.com/u/serjoscha87)\
**Post date:** [March 29, 2019, 8:21am UTC](https://discourse.getcockpit.com/t/how-can-i-filter-within-collection-link-e-g-filter-collection-field-value/690/5 "2019-03-29T08:21:22Z")

</div>

Now **I am** actually confused - gonna take a look into this later for the satisfaction of my own curiosity. Thanks for the hint.
