Type something to search...

Blog

How to Dereference Documents in GROQ

How to Dereference Documents in GROQ

To dereference documents in GROQ, add the -> operator after a reference field. A reference is stored as an object with a _ref ID, and -> re

Dive Deeper
How to Filter and Sort Data With GROQ

How to Filter and Sort Data With GROQ

To filter and sort data with GROQ, put a condition inside square brackets after the *, such as *[_type == "post" && featured == true], then p

Dive Deeper
How to Write Full-Text Search Queries in GROQ

How to Write Full-Text Search Queries in GROQ

To write full-text search queries in GROQ, use the match operator in a filter, such as *[_type == "post" && title match "groq*"]. match spl

Dive Deeper
Using GROQ Functions: count(), defined(), and More

Using GROQ Functions: count(), defined(), and More

GROQ functions are built-in helpers you call inside filters and projections to test, transform and compute values. The ones you'll use most are `

Dive Deeper
How to Query Nested Arrays in GROQ

How to Query Nested Arrays in GROQ

To query nested arrays in GROQ, use the [] traversal operator to step into each array, then add a filter or projection at the level you need. F

Dive Deeper
Using GROQ Parameters Safely in Your Queries

Using GROQ Parameters Safely in Your Queries

GROQ parameters are named placeholders, written with a dollar sign such as $slug, that you put in a query and fill with values sent separately.

Dive Deeper