
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can help you with filtering an array of strings in GROQ! Based on your example where platform is an array like ['ios', 'android'], here are the correct ways to filter it:
*[_type == 'bannerQueue' && "ios" in platform] {
banners[]->{
_id,
bannerType,
"description": description[$lang],
"imageUrl": image.asset->url,
platform,
}
}[0]The in operator checks if a value exists in an array. So "ios" in platform returns true if the platform array contains "ios".
*[_type == 'bannerQueue'] {
banners[]->{
_id,
bannerType,
"description": description[$lang],
"imageUrl": image.asset->url,
platform,
}["ios" in platform || "android" in platform]
}[0]Here you're dereferencing the banners first with []->, then filtering the results with another filter that checks if the platform array contains your desired values.
in operator - You need "ios" in platform, not platform == "ios"->) if you're filtering the referenced documents[]-> when dereferencing an array of referencesThe key insight from the GROQ documentation is that the in operator is specifically designed for matching values in arrays: *["sci-fi" in genres] matches all documents where genres is an array containing the value "sci-fi".
Try the first example if you're filtering at the bannerQueue level, or the second if you need to filter the individual banners after dereferencing them!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store