Join live – Get insights, tips, + Q&A from Sanity developers on our latest releases

Query Question - How to Filter a Reference for Active Documents

3 replies
Last updated: Jun 7, 2022
Hello, i have noob question about Query’s 🤔 I have a field with a reference, like in this screenshot. I directly extract some value of the document that is referenced.But how can i filter this reference? For example, like in the screenshot, i only want to get the active documents? If i try to filter the Document (like in the other screenshot) i get all documents from this type, but not only the referenced documents..
Thank you
Jun 7, 2022, 11:13 AM
This should do I think:
openJobs[@ -> active] { … }
Jun 7, 2022, 11:13 AM
Yes.. thanks that works 🙌
Jun 7, 2022, 11:24 AM
Lovely. 💚
Jun 7, 2022, 11:31 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?

Categorized in