diff --git a/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts b/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts index 14d8718b92..ff97307dc1 100644 --- a/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts +++ b/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts @@ -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); }