diff --git a/packages/server/src/integrations/mongodb.ts b/packages/server/src/integrations/mongodb.ts index eeff616cbd..70419be58b 100644 --- a/packages/server/src/integrations/mongodb.ts +++ b/packages/server/src/integrations/mongodb.ts @@ -564,14 +564,14 @@ class MongoIntegration implements IntegrationBase { query.steps.map(({ key, value }) => { let temp: any = {} temp[key] = JSON.parse(value.value) - return temp + return this.createObjectIds(temp) }) )) { response.push(doc) } } else { const stages: Array = query.json as Array - for await (const doc of collection.aggregate(stages ? stages : [])) { + for await (const doc of collection.aggregate(stages ? this.createObjectIds(stages) : [])) { response.push(doc) } }