1.8.5 (2023-06-03)
Features
- allows objectid through relationship validation (42afa6b)
Tag Name: v1.8.5
Release Date: 6/3/2023
Payload CMSPayload CMS is a modern, self-hosted headless content management system built with TypeScript, Node.js, and MongoDB. It's designed specifically for developers who want full control over their content management system while maintaining a powerful admin interface for content editors.
This minor release adds support for ObjectId values to pass through relationship validation, making it easier to work with MongoDB ObjectIds directly in your relationship fields. This improvement streamlines development workflows when dealing with relationships in Payload CMS.
No migration is required for this release. The new ObjectId validation support is backward compatible with existing code that uses string IDs in relationship fields.
This is a minor feature release that adds functionality without breaking changes. It's safe to upgrade from v1.8.4 to v1.8.5 without code modifications.
To upgrade:
npm install [email protected]
# or
yarn add [email protected]
If you're using ObjectIds directly in your code with relationship fields, you may now simplify your code by removing any string conversion steps that were previously required.
No specific bug fixes were included in this release.
Payload CMS now allows MongoDB ObjectId values to pass through relationship validation. This means you can directly use ObjectId instances when setting or updating relationship fields, without needing to convert them to strings first.
This enhancement is particularly useful when:
// Example: Now valid in relationship fields
const objectId = new mongoose.Types.ObjectId('507f1f77bcf86cd799439011');
await payload.update({
collection: 'posts',
id: '123',
data: {
author: objectId, // Works directly with ObjectId
},
});
No security fixes were included in this release.
No specific performance improvements were mentioned in this release.
This release has a low impact on existing applications but provides a quality-of-life improvement for developers working with MongoDB relationships. The addition of ObjectId support in relationship validation makes the API more flexible and reduces the need for type conversions when working with MongoDB's native data types. This change is fully backward compatible and requires no migration steps.