Fixed mixin projections in postgres adapter (#8838)

Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
Victor Ilyushchenko
2025-05-05 17:56:06 +05:00
committed by GitHub
parent 5dfef1f218
commit 4a24ca257f
2 changed files with 41 additions and 14 deletions
+3
View File
@@ -554,6 +554,9 @@ export function convertArrayParams (parameters?: ParameterOrJSON<any>[]): any[]
}
export function filterProjection<T extends Doc> (data: any, projection: Projection<T> | undefined): any {
if (projection === undefined) {
return data
}
for (const key in data) {
if (!Object.prototype.hasOwnProperty.call(projection, key) || (projection as any)[key] === 0) {
// check nested projections in case of object