Add support for ObjectId in aggregations
This commit is contained in:
parent
ac3d389163
commit
436cbed74b
|
@ -564,14 +564,14 @@ class MongoIntegration implements IntegrationBase {
|
||||||
query.steps.map(({ key, value }) => {
|
query.steps.map(({ key, value }) => {
|
||||||
let temp: any = {}
|
let temp: any = {}
|
||||||
temp[key] = JSON.parse(value.value)
|
temp[key] = JSON.parse(value.value)
|
||||||
return temp
|
return this.createObjectIds(temp)
|
||||||
})
|
})
|
||||||
)) {
|
)) {
|
||||||
response.push(doc)
|
response.push(doc)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const stages: Array<any> = query.json as Array<any>
|
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)
|
response.push(doc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue