Discussing the best way to model temperature data in Sanity.io
At its core, a document is a JSON-object that has a unique _id, timestamps (_createdAt, _updatedAt) and revision-marker _rev.export default {
name: 'temperature',
title: 'Temperature',
type: 'document',
fields: [
{
name: 'temperature',
title: 'Temperature',
type: 'number'
},
{
name: 'city',
title: 'City',
to: [
{type: 'city'}
]
type: 'reference'
}
]
}export default {
name: 'city',
title: 'City',
type: 'document',
fields: [
{
name: 'name',
title: 'name',
type: 'string'
},
]
}Was this answer helpful?
Sanity – Build the way you think, not the way your CMS thinks
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.