1
0
Fork 0
mirror of synced 2024-06-14 16:35:02 +12:00

Add support for ObjectId in aggregations

This commit is contained in:
Mel O'Hagan 2022-10-12 18:54:53 +01:00
parent 48d84d67bf
commit 98871064a9

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)
}
}