fix: findDistinct with polymorphic relationships (#13875)
Fixes `findDistinct` with polymorphic relationships and also fixes a bug from https://github.com/payloadcms/payload/pull/13840 when `findDistinct` didn't work properly for `hasMany` relationships in mongodb if `sort` is the same as `field` --------- Co-authored-by: Patrik Kozak <35232443+PatrikKozak@users.noreply.github.com>
This commit is contained in:
@@ -132,6 +132,17 @@ export const getConfig: () => Partial<Config> = () => ({
|
||||
hasMany: true,
|
||||
name: 'categories',
|
||||
},
|
||||
{
|
||||
type: 'relationship',
|
||||
relationTo: ['categories'],
|
||||
name: 'categoryPoly',
|
||||
},
|
||||
{
|
||||
type: 'relationship',
|
||||
relationTo: ['categories'],
|
||||
hasMany: true,
|
||||
name: 'categoryPolyMany',
|
||||
},
|
||||
{
|
||||
type: 'relationship',
|
||||
relationTo: 'categories-custom-id',
|
||||
|
||||
Reference in New Issue
Block a user