Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(db-mongodb): ensure relationships are stored in ObjectID #8932

Conversation

r1tsuu
Copy link
Member

@r1tsuu r1tsuu commented Oct 29, 2024

What?

Since the join field, we do store relationship fields values in ObjectID. This wasn't true if the field is nested to an array / blocks.

Why?

All relationship fields values should be stored in ObjectID.

How?

Fixes arrays / blocks handling in the traverseFields.ts function. Before it didn't run for them.

Copy link
Contributor

@DanRibbens DanRibbens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, one little refactor to make.

packages/payload/src/utilities/traverseFields.ts Outdated Show resolved Hide resolved
@DanRibbens DanRibbens merged commit d64946c into beta Oct 30, 2024
48 checks passed
@DanRibbens DanRibbens deleted the fix/store-nested-to-arrays-and-blocks-relationship-fields-in-ObjectID-with-the-mongodb-adapter branch October 30, 2024 17:42
Copy link
Contributor

🚀 This is included in version v3.0.0-beta.121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants