
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeLooking at your question, I believe you're asking about how to reference multiple documents in a schema field. The most common way to do this in Sanity is using an array of references.
Here's how you structure it in your schema:
{
name: 'relatedArticles',
title: 'Related Articles',
type: 'array',
of: [
{
type: 'reference',
to: [{type: 'article'}]
}
]
}This allows editors to add multiple document references to a single field. If you want to reference multiple different document types in the same array, you can do:
{
name: 'resources',
title: 'Resources',
type: 'array',
of: [
{
type: 'reference',
to: [
{type: 'article'},
{type: 'video'},
{type: 'podcast'}
]
}
]
}As explained in the array fields documentation, array fields create orderable collections where editors can:
_key automaticallyYou can also mix different types within the same array if you need more complex structures:
{
name: 'content',
title: 'Content Blocks',
type: 'array',
of: [
{
type: 'reference',
to: [{type: 'article'}]
},
{
type: 'image'
},
{
type: 'object',
name: 'textBlock',
fields: [
{name: 'text', type: 'text'}
]
}
]
}The array approach is much more flexible than single reference fields and is the standard Sanity pattern for "one-to-many" relationships. Editors can add unlimited documents (though you can add validation rules to set min/max limits if needed).
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