Add support for ObjectId in aggregations

This commit is contained in:
Mel O'Hagan 2022-10-12 18:54:53 +01:00
parent ac3d389163
commit 436cbed74b
1 changed files with 2 additions and 2 deletions

View File

@ -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<any> = query.json as Array<any>
for await (const doc of collection.aggregate(stages ? stages : [])) {
for await (const doc of collection.aggregate(stages ? this.createObjectIds(stages) : [])) {
response.push(doc)
}
}