Relationship Enhancer

Clears links to deleted documents and keeps two-way relationships in sync

Community 12 315/wk MIT v0.0.10

Installation

pnpm add payload-relationship-enhancer

About

Relationship Enhancer adds referential integrity to relationship fields between collections. When a document is deleted, other documents that pointed to it lose that link, so no record keeps a reference to something that no longer exists.

It also adds bi-directional relationships. When one document references another, the referenced document can show the reverse link, and both sides stay updated when either one changes. The reverse link appears in the API responses, so you do not need to write a lookup at query time. The plugin only works with MongoDB and skips relationship fields nested inside arrays. Changes it makes do not run lifecycle hooks, so test it against your own relationship setup before relying on it.

Package info

Package name
payload-relationship-enhancer
Latest version
0.0.10
Unpacked size
542 kB
License
MIT
Weekly downloads
315
Last publish
Jan 2, 2024

Similar plugins

More in Content

Adds question-based conditions that decide which pages a visitor sees

Opens nested blocks and array rows in stacked panels with breadcrumb navigation

Click-to-edit overlays on the frontend that open the matching field in the admin

Inline editing on your live website for Payload content, with reviewed drafts

Visual drag-and-drop page builder for Payload collections with live canvas editing

Adds a parent field and breadcrumbs to collections so documents can nest inside each other