nuxt / nuxt/content

feat(content): support nested collection relations

Open
#3,352 16 comments 22 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
3.7k
Forks
746
Avg merge
1d 16h
Merged PRs (30d)
3

Description

Is your feature request related to a problem? Please describe

For the development of the new website for the 3D printing conference Printed-Amsterdam, I chose Nuxt3 with @nuxt/content in combination with NuxtStudio. This setup is intended to provide an intuitive and user-friendly experience, especially for non-technical users.

However, during the creation of the data schema, two fundamental missing features became apparent:

  • Content files with a type == data schema are not being validated (see #3351 ).
  • Nested collections for managing relations are not supported (this feature request).

The project is available as an open-source repository for the community:
https://github.com/toddeTV/quick-conf

Describe the solution you'd like

It would be extremely helpful to support relationships between collections. Since @nuxt/content v3 now uses an underlying SQLite database, this should be more feasible than in previous versions.

As a practical example, in the current project, a talk can be given by one or more speakers. This scenario requires a many-to-many relationship. It would be ideal if such relationships could be defined in both directions, but even a basic one-way reference would unlock a wide range of powerful use cases - especially since reverse querying is still possible with a bit of logic.

Describe alternatives you've considered

Currently, the only workaround is to manually create slugs and reference them across collections without any form of validation during build time. This approach is inconvenient and error-prone, making @nuxt/content projects difficult to scale.

Alternatively, switching to another headless CMS is possible, but that would mean leaving the Nuxt ecosystem. However, relationships between collections are a basic feature required by many projects beyond simple blogs.

Additional context

This would be a great enhancement for NuxtStudio in particular, as it could provide a searchable dropdown field for linking entries from another collection.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no implementation files or tests; start by tracing the Nuxt Content v3 collection and schema path backed by SQLite, then review the quick-conf talk and speaker model. Define the minimum one-way nested relation and its validation behavior; done should cover the many-to-many example and the searchable NuxtStudio linking workflow described.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxtjs, sqlite, typescript
Domain
content, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.