Hello, I encountered the following issue when trying to edit data in the
joinfield. If I set
collectionas an array, I get an error, but if I join to a single collection, it works fine:
{
name: 'assets',
type: 'join',
collection: ['digital-assets'],
on: 'product',
}{
name: 'assets',
type: 'join',
collection: 'digital-assets',
on: 'product',
}I’m not sure whether I’m doing something wrong or if this is a bug in Payload.
Hey
@1111523060026183682this is an easy one, but I can see why it might cause confusion
If you’re only ever joining one collection use a string:
collection: 'digital-assets'Only use the array form when you truly need multiple collections (polymorphic join):
collection: ['digital-assets', 'other-collection']when you pass an array, Payload treats the join as polymorphic, even if the array only has one collection
Star
Discord
online
Get dedicated engineering support directly from the Payload team.