fix(db-mongodb): 4x and more level deep relationships querying (#12800)
Fixes https://github.com/payloadcms/payload/issues/12721
This commit is contained in:
@@ -245,10 +245,13 @@ export async function buildSearchParam({
|
||||
value: { $in },
|
||||
}
|
||||
} else {
|
||||
relationshipQuery = {
|
||||
value: {
|
||||
_id: { $in },
|
||||
},
|
||||
const nextSubPath = pathsToQuery[i + 1]?.path
|
||||
if (nextSubPath) {
|
||||
relationshipQuery = {
|
||||
value: {
|
||||
[nextSubPath]: { $in },
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user