{"id":19301880,"url":"https://github.com/payloadcms/plugin-relationship-object-ids","last_synced_at":"2025-04-22T10:33:19.047Z","repository":{"id":172090459,"uuid":"648834185","full_name":"payloadcms/plugin-relationship-object-ids","owner":"payloadcms","description":"A Payload plugin to store all relationship IDs as ObjectIDs","archived":false,"fork":false,"pushed_at":"2024-07-26T15:07:48.000Z","size":315,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-07-26T16:53:11.563Z","etag":null,"topics":["payload-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/payloadcms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-03T00:09:21.000Z","updated_at":"2024-07-26T15:07:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"6caa4536-30f7-49d7-84bd-6bc46e3ef414","html_url":"https://github.com/payloadcms/plugin-relationship-object-ids","commit_stats":null,"previous_names":["payloadcms/plugin-relationship-object-ids"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/payloadcms%2Fplugin-relationship-object-ids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/payloadcms%2Fplugin-relationship-object-ids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/payloadcms%2Fplugin-relationship-object-ids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/payloadcms%2Fplugin-relationship-object-ids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/payloadcms","download_url":"https://codeload.github.com/payloadcms/plugin-relationship-object-ids/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223893785,"owners_count":17220944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["payload-plugin"],"created_at":"2024-11-09T23:19:10.629Z","updated_at":"2024-11-09T23:19:11.560Z","avatar_url":"https://github.com/payloadcms.png","language":"JavaScript","readme":"# Payload Relationship ObjectID Plugin\n\nThis plugin automatically enables all Payload `relationship` and `upload` field types to be stored as `ObjectID`s in MongoDB.\n\nMinimum required version of Payload: `1.9.5`\n\n## What it does\n\nIt injects a `beforeChange` field hook into each `relationship` and `upload` field, which converts string-based IDs to `ObjectID`s immediately prior to storage.\n\n#### Usage\n\nSimply import and install the plugin to make it work:\n\n```ts\nimport { relationshipsAsObjectID } from '@payloadcms/plugin-relationship-object-ids'\nimport { buildConfig } from 'payload/config'\n\nexport default buildConfig({\n  // your config here\n  plugins: [\n    // Call the plugin within your `plugins` array\n    relationshipsAsObjectID()\n  ]\n})\n```\n\n### Migration\n\nNote - this plugin will only store newly created or resaved documents' relations as `ObjectID`s. It will not modify any of your existing data. If you'd like to convert existing data into an `ObjectID` format, you should write a migration script to loop over all documents in your database and then simply resave each one. \n\n### Support\n\nIf you need help with this plugin, [join our Discord](https://t.co/30APlsQUPB) and we'd be happy to give you a hand.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpayloadcms%2Fplugin-relationship-object-ids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpayloadcms%2Fplugin-relationship-object-ids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpayloadcms%2Fplugin-relationship-object-ids/lists"}