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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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