fix(MongoDB Node): Fix checks on projection feature call (#10563)

This commit is contained in:
Mickaël Andrieu
2024-12-16 10:28:54 +01:00
committed by GitHub
parent 14c33f666f
commit 58bab461c4

View File

@@ -210,7 +210,11 @@ export class MongoDb implements INodeType {
query = query.sort(sort);
}
if (projection && projection instanceof Document) {
if (
projection &&
Object.keys(projection).length !== 0 &&
projection.constructor === Object
) {
query = query.project(projection);
}