[{"data":1,"prerenderedAt":1212},["ShallowReactive",2],{"navigation_docs":3,"-docs-core-content-modeling-relations":478,"-docs-core-content-modeling-relations-surround":1207},[4,352,446],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Docs",false,"\u002Fdocs\u002Fcore","docs\u002F1.core",[10,35,141,174,195,212,242,318],{"title":11,"icon":6,"path":12,"stem":13,"children":14,"page":6},"Getting Started","\u002Fdocs\u002Fcore\u002Fgetting-started","docs\u002F1.core\u002F1.getting-started",[15,19,23,27,31],{"title":16,"path":17,"stem":18},"Introduction","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fintroduction","docs\u002F1.core\u002F1.getting-started\u002F1.introduction",{"title":20,"path":21,"stem":22},"Quick Start","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fquick-start","docs\u002F1.core\u002F1.getting-started\u002F2.quick-start",{"title":24,"path":25,"stem":26},"Add to an Existing Site","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fexisting-site","docs\u002F1.core\u002F1.getting-started\u002F3.existing-site",{"title":28,"path":29,"stem":30},"Configuration","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fconfiguration","docs\u002F1.core\u002F1.getting-started\u002F4.configuration",{"title":32,"path":33,"stem":34},"How Tenon works","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fhow-tenon-works","docs\u002F1.core\u002F1.getting-started\u002F5.how-tenon-works",{"title":36,"icon":6,"path":37,"stem":38,"children":39,"page":6},"Content Modeling","\u002Fdocs\u002Fcore\u002Fcontent-modeling","docs\u002F1.core\u002F2.content-modeling",[40,44,111,115,119],{"title":41,"path":42,"stem":43},"Collections and Globals","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fcollections-and-globals","docs\u002F1.core\u002F2.content-modeling\u002F1.collections-and-globals",{"title":45,"icon":6,"path":46,"stem":47,"children":48},"Fields","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002Findex",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Array","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Farray","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F01.array",{"title":56,"path":57,"stem":58},"Blocks","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fblocks","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F02.blocks",{"title":60,"path":61,"stem":62},"Boolean","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fboolean","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F03.boolean",{"title":64,"path":65,"stem":66},"Date","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fdate","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F04.date",{"title":68,"path":69,"stem":70},"File","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ffile","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F05.file",{"title":72,"path":73,"stem":74},"Group","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fgroup","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F06.group",{"title":76,"path":77,"stem":78},"Image","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fimage","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F07.image",{"title":80,"path":81,"stem":82},"Link","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Flink","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F08.link",{"title":84,"path":85,"stem":86},"Number","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fnumber","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F09.number",{"title":88,"path":89,"stem":90},"Relation","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frelation","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F10.relation",{"title":92,"path":93,"stem":94},"Rich text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frich-text","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F11.rich-text",{"title":96,"path":97,"stem":98},"Select","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fselect","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F12.select",{"title":100,"path":101,"stem":102},"Size","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fsize","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F13.size",{"title":104,"path":105,"stem":106},"Slug","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fslug","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F14.slug",{"title":108,"path":109,"stem":110},"Text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ftext","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F15.text",{"title":112,"path":113,"stem":114},"Relations","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Frelations","docs\u002F1.core\u002F2.content-modeling\u002F3.relations",{"title":116,"path":117,"stem":118},"Media","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fmedia","docs\u002F1.core\u002F2.content-modeling\u002F4.media",{"title":120,"icon":6,"path":121,"stem":122,"children":123},"Presets","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002Findex",[124,125,129,133,137],{"title":50,"path":121,"stem":122},{"title":126,"path":127,"stem":128},"Menu","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fmenu","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F1.menu",{"title":130,"path":131,"stem":132},"Pages","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fpages","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F2.pages",{"title":134,"path":135,"stem":136},"Settings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fsettings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F3.settings",{"title":138,"path":139,"stem":140},"Strings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fstrings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F4.strings",{"title":142,"icon":6,"path":143,"stem":144,"children":145,"page":6},"Working with Content","\u002Fdocs\u002Fcore\u002Fworking-with-content","docs\u002F1.core\u002F3.working-with-content",[146,150,154,158,162,166,170],{"title":147,"path":148,"stem":149},"Reading","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Freading","docs\u002F1.core\u002F3.working-with-content\u002F1.reading",{"title":151,"path":152,"stem":153},"Writing and Drafts","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fwriting","docs\u002F1.core\u002F3.working-with-content\u002F2.writing",{"title":155,"path":156,"stem":157},"Scheduled publishing","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fscheduled-publishing","docs\u002F1.core\u002F3.working-with-content\u002F3.scheduled-publishing",{"title":159,"path":160,"stem":161},"HTTP API and Client","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhttp-api-and-client","docs\u002F1.core\u002F3.working-with-content\u002F4.http-api-and-client",{"title":163,"path":164,"stem":165},"Headless","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fheadless","docs\u002F1.core\u002F3.working-with-content\u002F5.headless",{"title":167,"path":168,"stem":169},"Localization","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Flocalization","docs\u002F1.core\u002F3.working-with-content\u002F6.localization",{"title":171,"path":172,"stem":173},"Hooks","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhooks","docs\u002F1.core\u002F3.working-with-content\u002F7.hooks",{"title":175,"icon":6,"path":176,"stem":177,"children":178,"page":6},"Building Your Site","\u002Fdocs\u002Fcore\u002Fbuilding-your-site","docs\u002F1.core\u002F4.building-your-site",[179,183,187,191],{"title":180,"path":181,"stem":182},"Pages and SEO","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fpages-and-seo","docs\u002F1.core\u002F4.building-your-site\u002F1.pages-and-seo",{"title":184,"path":185,"stem":186},"Components","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fcomponents","docs\u002F1.core\u002F4.building-your-site\u002F2.components",{"title":188,"path":189,"stem":190},"Menus","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fmenus","docs\u002F1.core\u002F4.building-your-site\u002F3.menus",{"title":192,"path":193,"stem":194},"Live Preview","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Flive-preview","docs\u002F1.core\u002F4.building-your-site\u002F4.live-preview",{"title":196,"icon":6,"path":197,"stem":198,"children":199,"page":6},"Users and Access","\u002Fdocs\u002Fcore\u002Fusers-and-access","docs\u002F1.core\u002F5.users-and-access",[200,204,208],{"title":201,"path":202,"stem":203},"Authentication","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fauthentication","docs\u002F1.core\u002F5.users-and-access\u002F1.authentication",{"title":205,"path":206,"stem":207},"Access Control","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Faccess-control","docs\u002F1.core\u002F5.users-and-access\u002F2.access-control",{"title":209,"path":210,"stem":211},"API Keys","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fapi-keys","docs\u002F1.core\u002F5.users-and-access\u002F3.api-keys",{"title":213,"icon":6,"path":214,"stem":215,"children":216},"Customization","\u002Fdocs\u002Fcore\u002Fcustomization","docs\u002F1.core\u002F6.customization\u002Findex",[217,218,222,226,230,234,238],{"title":50,"path":214,"stem":215},{"title":219,"path":220,"stem":221},"Admin","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fadmin","docs\u002F1.core\u002F6.customization\u002F1.admin",{"title":223,"path":224,"stem":225},"Custom Fields","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-fields","docs\u002F1.core\u002F6.customization\u002F2.custom-fields",{"title":227,"path":228,"stem":229},"Custom Pages and Actions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-pages-and-actions","docs\u002F1.core\u002F6.customization\u002F3.custom-pages-and-actions",{"title":231,"path":232,"stem":233},"Styles and UI Libraries","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fstyles-and-ui-libraries","docs\u002F1.core\u002F6.customization\u002F4.styles-and-ui-libraries",{"title":235,"path":236,"stem":237},"Rich Text Extensions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Frich-text-extensions","docs\u002F1.core\u002F6.customization\u002F5.rich-text-extensions",{"title":239,"path":240,"stem":241},"Plugins","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fplugins","docs\u002F1.core\u002F6.customization\u002F6.plugins",{"title":243,"icon":6,"path":244,"stem":245,"children":246},"Operations","\u002Fdocs\u002Fcore\u002Foperations","docs\u002F1.core\u002F7.operations\u002Findex",[247,248,266,288,306,310,314],{"title":50,"path":244,"stem":245},{"title":249,"icon":6,"path":250,"stem":251,"children":252},"Email","\u002Fdocs\u002Fcore\u002Foperations\u002Femail","docs\u002F1.core\u002F7.operations\u002F1.email\u002Findex",[253,254,258,262],{"title":50,"path":250,"stem":251},{"title":255,"path":256,"stem":257},"SMTP","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fsmtp","docs\u002F1.core\u002F7.operations\u002F1.email\u002F1.smtp",{"title":259,"path":260,"stem":261},"Cloudflare","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcloudflare","docs\u002F1.core\u002F7.operations\u002F1.email\u002F2.cloudflare",{"title":263,"path":264,"stem":265},"Custom adapter","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcustom-adapter","docs\u002F1.core\u002F7.operations\u002F1.email\u002F3.custom-adapter",{"title":267,"icon":6,"path":268,"stem":269,"children":270},"Jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002Findex",[271,272,276,280,284],{"title":50,"path":268,"stem":269},{"title":273,"path":274,"stem":275},"Queue jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fqueue-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F1.queue-jobs",{"title":277,"path":278,"stem":279},"Recurring jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Frecurring-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F2.recurring-jobs",{"title":281,"path":282,"stem":283},"The clock","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fclock","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F3.clock",{"title":285,"path":286,"stem":287},"Manage jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fmanage-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F4.manage-jobs",{"title":289,"icon":6,"path":290,"stem":291,"children":292},"Webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002Findex",[293,294,298,302],{"title":50,"path":290,"stem":291},{"title":295,"path":296,"stem":297},"Send webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Fsend-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F1.send-webhooks",{"title":299,"path":300,"stem":301},"Receive webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Freceive-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F2.receive-webhooks",{"title":303,"path":304,"stem":305},"Rebuild on publish","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Frebuild-on-publish","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F3.rebuild-on-publish",{"title":307,"path":308,"stem":309},"Backup and Restore","\u002Fdocs\u002Fcore\u002Foperations\u002Fbackup-and-restore","docs\u002F1.core\u002F7.operations\u002F4.backup-and-restore",{"title":311,"path":312,"stem":313},"Lifecycle Hooks","\u002Fdocs\u002Fcore\u002Foperations\u002Flifecycle-hooks","docs\u002F1.core\u002F7.operations\u002F5.lifecycle-hooks",{"title":315,"path":316,"stem":317},"Upgrades and Schema Changes","\u002Fdocs\u002Fcore\u002Foperations\u002Fupgrades-and-schema-changes","docs\u002F1.core\u002F7.operations\u002F6.upgrades-and-schema-changes",{"title":319,"icon":6,"path":320,"stem":321,"children":322,"page":6},"Reference","\u002Fdocs\u002Fcore\u002Freference","docs\u002F1.core\u002F8.reference",[323,326,344,348],{"title":28,"path":324,"stem":325},"\u002Fdocs\u002Fcore\u002Freference\u002Fconfiguration","docs\u002F1.core\u002F8.reference\u002F1.configuration",{"title":327,"icon":6,"path":328,"stem":329,"children":330},"API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi","docs\u002F1.core\u002F8.reference\u002F2.api\u002Findex",[331,332,336,340],{"title":50,"path":328,"stem":329},{"title":333,"path":334,"stem":335},"Local API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Flocal-api","docs\u002F1.core\u002F8.reference\u002F2.api\u002F1.local-api",{"title":337,"path":338,"stem":339},"Client","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fclient","docs\u002F1.core\u002F8.reference\u002F2.api\u002F2.client",{"title":341,"path":342,"stem":343},"HTTP routes","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fhttp-routes","docs\u002F1.core\u002F8.reference\u002F2.api\u002F3.http-routes",{"title":345,"path":346,"stem":347},"Errors and types","\u002Fdocs\u002Fcore\u002Freference\u002Ferrors-and-types","docs\u002F1.core\u002F8.reference\u002F3.errors-and-types",{"title":349,"path":350,"stem":351},"Package exports","\u002Fdocs\u002Fcore\u002Freference\u002Fpackage-exports","docs\u002F1.core\u002F8.reference\u002F4.package-exports",{"title":353,"icon":6,"path":354,"stem":355,"children":356,"page":6},"Guide","\u002Fdocs\u002Fguide","docs\u002F2.guide",[357,383,400,417],{"title":358,"icon":6,"path":359,"stem":360,"children":361},"Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks","docs\u002F2.guide\u002F1.frameworks\u002Findex",[362,363,367,371,375,379],{"title":50,"path":359,"stem":360},{"title":364,"path":365,"stem":366},"Astro","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fastro","docs\u002F2.guide\u002F1.frameworks\u002F1.astro",{"title":368,"path":369,"stem":370},"Nuxt","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fnuxt","docs\u002F2.guide\u002F1.frameworks\u002F2.nuxt",{"title":372,"path":373,"stem":374},"TanStack Start","\u002Fdocs\u002Fguide\u002Fframeworks\u002Ftanstack-start","docs\u002F2.guide\u002F1.frameworks\u002F3.tanstack-start",{"title":376,"path":377,"stem":378},"Standalone","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fstandalone","docs\u002F2.guide\u002F1.frameworks\u002F4.standalone",{"title":380,"path":381,"stem":382},"Other Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fother-frameworks","docs\u002F2.guide\u002F1.frameworks\u002F5.other-frameworks",{"title":384,"icon":6,"path":385,"stem":386,"children":387},"Deployment","\u002Fdocs\u002Fguide\u002Fdeployment","docs\u002F2.guide\u002F2.deployment\u002Findex",[388,389,393,397],{"title":50,"path":385,"stem":386},{"title":390,"path":391,"stem":392},"Node","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fnode","docs\u002F2.guide\u002F2.deployment\u002F1.node",{"title":394,"path":395,"stem":396},"Vercel","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fvercel","docs\u002F2.guide\u002F2.deployment\u002F2.vercel",{"title":259,"path":398,"stem":399},"\u002Fdocs\u002Fguide\u002Fdeployment\u002Fcloudflare","docs\u002F2.guide\u002F2.deployment\u002F3.cloudflare",{"title":401,"icon":6,"path":402,"stem":403,"children":404,"page":6},"Databases and Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage","docs\u002F2.guide\u002F3.databases-and-storage",[405,409,413],{"title":406,"path":407,"stem":408},"Databases","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fdatabases","docs\u002F2.guide\u002F3.databases-and-storage\u002F1.databases",{"title":410,"path":411,"stem":412},"Media Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fmedia-storage","docs\u002F2.guide\u002F3.databases-and-storage\u002F2.media-storage",{"title":414,"path":415,"stem":416},"Image Providers","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fimage-providers","docs\u002F2.guide\u002F3.databases-and-storage\u002F3.image-providers",{"title":418,"icon":6,"path":419,"stem":420,"children":421,"page":6},"Recipes","\u002Fdocs\u002Fguide\u002Frecipes","docs\u002F2.guide\u002F4.recipes",[422,426,430,434,438,442],{"title":423,"path":424,"stem":425},"Seed Content","\u002Fdocs\u002Fguide\u002Frecipes\u002Fseed-content","docs\u002F2.guide\u002F4.recipes\u002F1.seed-content",{"title":427,"path":428,"stem":429},"Tracking and Consent","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftracking-and-consent","docs\u002F2.guide\u002F4.recipes\u002F2.tracking-and-consent",{"title":431,"path":432,"stem":433},"Build a Custom Field","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-custom-field","docs\u002F2.guide\u002F4.recipes\u002F3.build-a-custom-field",{"title":435,"path":436,"stem":437},"Write a Plugin","\u002Fdocs\u002Fguide\u002Frecipes\u002Fwrite-a-plugin","docs\u002F2.guide\u002F4.recipes\u002F4.write-a-plugin",{"title":439,"path":440,"stem":441},"Build a Headless Site with Next.js","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-headless-site-with-nextjs","docs\u002F2.guide\u002F4.recipes\u002F5.build-a-headless-site-with-nextjs",{"title":443,"path":444,"stem":445},"Troubleshooting","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftroubleshooting","docs\u002F2.guide\u002F4.recipes\u002F6.troubleshooting",{"title":447,"icon":6,"path":448,"stem":449,"children":450,"page":6},"CLI","\u002Fdocs\u002Fcli","docs\u002F3.cli",[451,454,458,462,466,470,474],{"title":50,"path":452,"stem":453},"\u002Fdocs\u002Fcli\u002Foverview","docs\u002F3.cli\u002F1.overview",{"title":455,"path":456,"stem":457},"create-tenoncms","\u002Fdocs\u002Fcli\u002Fcreate-tenoncms","docs\u002F3.cli\u002F2.create-tenoncms",{"title":459,"path":460,"stem":461},"tenon backup","\u002Fdocs\u002Fcli\u002Fbackup","docs\u002F3.cli\u002F3.backup",{"title":463,"path":464,"stem":465},"tenon users","\u002Fdocs\u002Fcli\u002Fusers","docs\u002F3.cli\u002F4.users",{"title":467,"path":468,"stem":469},"tenon media","\u002Fdocs\u002Fcli\u002Fmedia","docs\u002F3.cli\u002F5.media",{"title":471,"path":472,"stem":473},"tenon upgrade","\u002Fdocs\u002Fcli\u002Fupgrade","docs\u002F3.cli\u002F6.upgrade",{"title":475,"path":476,"stem":477},"tenon login","\u002Fdocs\u002Fcli\u002Flogin","docs\u002F3.cli\u002F7.login",{"id":479,"title":112,"body":480,"description":1201,"extension":1202,"links":1203,"meta":1204,"navigation":576,"path":113,"seo":1205,"stem":114,"__hash__":1206},"docs\u002Fdocs\u002F1.core\u002F2.content-modeling\u002F3.relations.md",{"type":481,"value":482,"toc":1195},"minimark",[483,487,505,510,516,756,817,828,833,840,920,930,996,1005,1009,1016,1096,1163,1191],[484,485,486],"p",{},"Documents can point to other documents: a post has an author, a product has tags. A read can load the related documents in the same call.",[484,488,489,490,497,498,504],{},"A ",[491,492,493],"a",{"href":89},[494,495,496],"code",{},"relation"," field stores the ids. A ",[491,499,501],{"href":500},"\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frelation#join",[494,502,503],{},"join"," lists the documents that point back. This page covers how reads load related documents and what happens when one is deleted.",[506,507,509],"h2",{"id":508},"populate","Populate",[484,511,512,513,515],{},"By default, a read loads related documents two levels deep. ",[494,514,508],{}," picks what to load:",[517,518,523],"pre",{"className":519,"code":520,"language":521,"meta":522,"style":522},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Every relation, two levels deep (the default)\nawait cms.find(\"posts\");\n\n\u002F\u002F Ids only\nawait cms.find(\"posts\", { populate: false });\n\n\u002F\u002F Only these paths\nawait cms.find(\"posts\", { populate: { author: { avatar: true }, tags: true } });\n\n\u002F\u002F A join loads only when you name it\nawait cms.find(\"authors\", { populate: { posts: true } });\n","ts","",[494,524,525,534,571,578,584,627,632,638,700,705,711],{"__ignoreMap":522},[526,527,530],"span",{"class":528,"line":529},"line",1,[526,531,533],{"class":532},"sHwdD","\u002F\u002F Every relation, two levels deep (the default)\n",[526,535,537,541,545,549,553,556,559,563,565,568],{"class":528,"line":536},2,[526,538,540],{"class":539},"s7zQu","await",[526,542,544],{"class":543},"sTEyZ"," cms",[526,546,548],{"class":547},"sMK4o",".",[526,550,552],{"class":551},"s2Zo4","find",[526,554,555],{"class":543},"(",[526,557,558],{"class":547},"\"",[526,560,562],{"class":561},"sfazB","posts",[526,564,558],{"class":547},[526,566,567],{"class":543},")",[526,569,570],{"class":547},";\n",[526,572,574],{"class":528,"line":573},3,[526,575,577],{"emptyLinePlaceholder":576},true,"\n",[526,579,581],{"class":528,"line":580},4,[526,582,583],{"class":532},"\u002F\u002F Ids only\n",[526,585,587,589,591,593,595,597,599,601,603,606,609,613,616,620,623,625],{"class":528,"line":586},5,[526,588,540],{"class":539},[526,590,544],{"class":543},[526,592,548],{"class":547},[526,594,552],{"class":551},[526,596,555],{"class":543},[526,598,558],{"class":547},[526,600,562],{"class":561},[526,602,558],{"class":547},[526,604,605],{"class":547},",",[526,607,608],{"class":547}," {",[526,610,612],{"class":611},"swJcz"," populate",[526,614,615],{"class":547},":",[526,617,619],{"class":618},"sfNiH"," false",[526,621,622],{"class":547}," }",[526,624,567],{"class":543},[526,626,570],{"class":547},[526,628,630],{"class":528,"line":629},6,[526,631,577],{"emptyLinePlaceholder":576},[526,633,635],{"class":528,"line":634},7,[526,636,637],{"class":532},"\u002F\u002F Only these paths\n",[526,639,641,643,645,647,649,651,653,655,657,659,661,663,665,667,670,672,674,677,679,682,685,688,690,692,694,696,698],{"class":528,"line":640},8,[526,642,540],{"class":539},[526,644,544],{"class":543},[526,646,548],{"class":547},[526,648,552],{"class":551},[526,650,555],{"class":543},[526,652,558],{"class":547},[526,654,562],{"class":561},[526,656,558],{"class":547},[526,658,605],{"class":547},[526,660,608],{"class":547},[526,662,612],{"class":611},[526,664,615],{"class":547},[526,666,608],{"class":547},[526,668,669],{"class":611}," author",[526,671,615],{"class":547},[526,673,608],{"class":547},[526,675,676],{"class":611}," avatar",[526,678,615],{"class":547},[526,680,681],{"class":618}," true",[526,683,684],{"class":547}," },",[526,686,687],{"class":611}," tags",[526,689,615],{"class":547},[526,691,681],{"class":618},[526,693,622],{"class":547},[526,695,622],{"class":547},[526,697,567],{"class":543},[526,699,570],{"class":547},[526,701,703],{"class":528,"line":702},9,[526,704,577],{"emptyLinePlaceholder":576},[526,706,708],{"class":528,"line":707},10,[526,709,710],{"class":532},"\u002F\u002F A join loads only when you name it\n",[526,712,714,716,718,720,722,724,726,729,731,733,735,737,739,741,744,746,748,750,752,754],{"class":528,"line":713},11,[526,715,540],{"class":539},[526,717,544],{"class":543},[526,719,548],{"class":547},[526,721,552],{"class":551},[526,723,555],{"class":543},[526,725,558],{"class":547},[526,727,728],{"class":561},"authors",[526,730,558],{"class":547},[526,732,605],{"class":547},[526,734,608],{"class":547},[526,736,612],{"class":611},[526,738,615],{"class":547},[526,740,608],{"class":547},[526,742,743],{"class":611}," posts",[526,745,615],{"class":547},[526,747,681],{"class":618},[526,749,622],{"class":547},[526,751,622],{"class":547},[526,753,567],{"class":543},[526,755,570],{"class":547},[757,758,759,766,779,790,807],"ul",{},[760,761,762,765],"li",{},[494,763,764],{},"true"," on a key loads one level. A nested object goes further.",[760,767,768,771,772,775,776,548],{},[494,769,770],{},"depth"," sets how far ",[494,773,774],{},"populate: true"," goes: ",[494,777,778],{},"cms.find(\"posts\", { depth: 1 })",[760,780,781,782,785,786,789],{},"A related document that no longer exists reads as ",[494,783,784],{},"null",". A ",[494,787,788],{},"many"," list leaves it out.",[760,791,792,793,795,796,799,800,803,804,548],{},"The result types follow ",[494,794,508],{},". With ",[494,797,798],{},"populate: false",", ",[494,801,802],{},"post.author"," is a ",[494,805,806],{},"string",[760,808,809,812,813,816],{},[494,810,811],{},"create"," and ",[494,814,815],{},"update"," return ids, not loaded documents.",[484,818,819,820,823,824,827],{},"Over HTTP, the same options are query parameters: ",[494,821,822],{},"?populate=author.avatar,tags"," or ",[494,825,826],{},"?populate=false",". HTTP reads stop at 5 levels.",[829,830,832],"h3",{"id":831},"keep-related-documents-small","Keep related documents small",[484,834,835,836,839],{},"A loaded document has all its fields. When a page only needs a few, set ",[494,837,838],{},"select"," on the relation field:",[517,841,843],{"className":519,"code":842,"language":521,"meta":522,"style":522},"author: {\n  type: \"relation\",\n  collection: \"authors\",\n  select: { name: true, avatar: true },\n},\n",[494,844,845,856,873,888,915],{"__ignoreMap":522},[526,846,847,851,853],{"class":528,"line":529},[526,848,850],{"class":849},"sBMFI","author",[526,852,615],{"class":547},[526,854,855],{"class":547}," {\n",[526,857,858,861,863,866,868,870],{"class":528,"line":536},[526,859,860],{"class":849},"  type",[526,862,615],{"class":547},[526,864,865],{"class":547}," \"",[526,867,496],{"class":561},[526,869,558],{"class":547},[526,871,872],{"class":547},",\n",[526,874,875,878,880,882,884,886],{"class":528,"line":573},[526,876,877],{"class":849},"  collection",[526,879,615],{"class":547},[526,881,865],{"class":547},[526,883,728],{"class":561},[526,885,558],{"class":547},[526,887,872],{"class":547},[526,889,890,893,895,897,900,902,904,906,908,910,912],{"class":528,"line":580},[526,891,892],{"class":849},"  select",[526,894,615],{"class":547},[526,896,608],{"class":547},[526,898,899],{"class":849}," name",[526,901,615],{"class":547},[526,903,681],{"class":618},[526,905,605],{"class":547},[526,907,676],{"class":849},[526,909,615],{"class":547},[526,911,681],{"class":618},[526,913,914],{"class":547}," },\n",[526,916,917],{"class":528,"line":586},[526,918,919],{"class":547},"},\n",[484,921,922,923,925,926,929],{},"Every read that loads ",[494,924,850],{}," now returns ",[494,927,928],{},"{ id, name, avatar }",". A read that selects inside the relation picks other fields instead:",[517,931,933],{"className":519,"code":932,"language":521,"meta":522,"style":522},"await cms.find(\"posts\", { select: { title: true, author: { bio: true } } });\n",[494,934,935],{"__ignoreMap":522},[526,936,937,939,941,943,945,947,949,951,953,955,957,960,962,964,967,969,971,973,975,977,979,982,984,986,988,990,992,994],{"class":528,"line":529},[526,938,540],{"class":539},[526,940,544],{"class":543},[526,942,548],{"class":547},[526,944,552],{"class":551},[526,946,555],{"class":543},[526,948,558],{"class":547},[526,950,562],{"class":561},[526,952,558],{"class":547},[526,954,605],{"class":547},[526,956,608],{"class":547},[526,958,959],{"class":611}," select",[526,961,615],{"class":547},[526,963,608],{"class":547},[526,965,966],{"class":611}," title",[526,968,615],{"class":547},[526,970,681],{"class":618},[526,972,605],{"class":547},[526,974,669],{"class":611},[526,976,615],{"class":547},[526,978,608],{"class":547},[526,980,981],{"class":611}," bio",[526,983,615],{"class":547},[526,985,681],{"class":618},[526,987,622],{"class":547},[526,989,622],{"class":547},[526,991,622],{"class":547},[526,993,567],{"class":543},[526,995,570],{"class":547},[484,997,998,999,1001,1002,1004],{},"See ",[491,1000,147],{"href":148}," for ",[494,1003,838],{}," and filters.",[506,1006,1008],{"id":1007},"when-a-document-is-deleted","When a document is deleted",[484,1010,1011,1012,1015],{},"When you delete a document, every relation that points to it applies its ",[494,1013,1014],{},"onDelete"," rule:",[1017,1018,1019,1036],"table",{},[1020,1021,1022],"thead",{},[1023,1024,1025,1030,1033],"tr",{},[1026,1027,1028],"th",{},[494,1029,1014],{},[1026,1031,1032],{},"What happens",[1026,1034,1035],{},"Default for",[1037,1038,1039,1058,1084],"tbody",{},[1023,1040,1041,1047,1055],{},[1042,1043,1044],"td",{},[494,1045,1046],{},"set-null",[1042,1048,1049,1050,785,1052,1054],{},"A single relation becomes ",[494,1051,784],{},[494,1053,788],{}," list drops the id.",[1042,1056,1057],{},"Optional relations",[1023,1059,1060,1065,1072],{},[1042,1061,1062],{},[494,1063,1064],{},"restrict",[1042,1066,1067,1068,1071],{},"The delete fails with a ",[494,1069,1070],{},"409"," and lists the documents that point to it.",[1042,1073,1074,1077,1078,799,1081],{},[494,1075,1076],{},"required"," relations, ",[494,1079,1080],{},"image",[494,1082,1083],{},"file",[1023,1085,1086,1091,1094],{},[1042,1087,1088],{},[494,1089,1090],{},"cascade",[1042,1092,1093],{},"The documents that point to it are deleted too.",[1042,1095],{},[517,1097,1099],{"className":519,"code":1098,"language":521,"meta":522,"style":522},"\u002F\u002F Delete the comments of a deleted post\npost: { type: \"relation\", collection: \"posts\", required: true, onDelete: \"cascade\" },\n",[494,1100,1101,1106],{"__ignoreMap":522},[526,1102,1103],{"class":528,"line":529},[526,1104,1105],{"class":532},"\u002F\u002F Delete the comments of a deleted post\n",[526,1107,1108,1111,1113,1115,1118,1120,1122,1124,1126,1128,1131,1133,1135,1137,1139,1141,1144,1146,1148,1150,1153,1155,1157,1159,1161],{"class":528,"line":536},[526,1109,1110],{"class":849},"post",[526,1112,615],{"class":547},[526,1114,608],{"class":547},[526,1116,1117],{"class":849}," type",[526,1119,615],{"class":547},[526,1121,865],{"class":547},[526,1123,496],{"class":561},[526,1125,558],{"class":547},[526,1127,605],{"class":547},[526,1129,1130],{"class":849}," collection",[526,1132,615],{"class":547},[526,1134,865],{"class":547},[526,1136,562],{"class":561},[526,1138,558],{"class":547},[526,1140,605],{"class":547},[526,1142,1143],{"class":849}," required",[526,1145,615],{"class":547},[526,1147,681],{"class":618},[526,1149,605],{"class":547},[526,1151,1152],{"class":849}," onDelete",[526,1154,615],{"class":547},[526,1156,865],{"class":547},[526,1158,1090],{"class":561},[526,1160,558],{"class":547},[526,1162,914],{"class":547},[757,1164,1165,1168,1181],{},[760,1166,1167],{},"Everything happens in one transaction, with the hooks of every changed document.",[760,1169,1170,1171,1173,1174,1177,1178,548],{},"In server code, a failed ",[494,1172,1064],{}," throws a ",[494,1175,1176],{},"ConflictError"," from ",[494,1179,1180],{},"tenoncms",[760,1182,489,1183,1185,1186,1188,1189,548],{},[494,1184,1076],{}," relation cannot use ",[494,1187,1046],{},". A global cannot use ",[494,1190,1090],{},[1192,1193,1194],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":522,"searchDepth":536,"depth":536,"links":1196},[1197,1200],{"id":508,"depth":536,"text":509,"children":1198},[1199],{"id":831,"depth":573,"text":832},{"id":1007,"depth":536,"text":1008},"Link documents and load them together.","md",null,{},{"title":112,"description":1201},"_HEnUMcRgPOo-ReF085Fa36_mAfMBX7QZs2P_IEHWzI",[1208,1210],{"title":108,"path":109,"stem":110,"description":1209,"children":-1},"One line or several lines of text, stored as a string.",{"title":116,"path":117,"stem":118,"description":1211,"children":-1},"Uploads, image and file fields, responsive images.",1795884673782]