1
0
Fork 0
mirror of synced 2024-06-14 00:14:39 +12:00
This commit is contained in:
Mel O'Hagan 2022-10-04 11:03:54 +01:00
parent dbf58fcfe9
commit 9a5b3b27aa

View file

@ -326,7 +326,11 @@ class MongoIntegration implements IntegrationBase {
}
}
async aggregate(query: { json: object; steps: any[]; extra: { [key: string]: string } }) {
async aggregate(query: {
json: object
steps: any[]
extra: { [key: string]: string }
}) {
try {
await this.connect()
const db = this.client.db(this.config.db)
@ -344,9 +348,7 @@ class MongoIntegration implements IntegrationBase {
}
} 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 ? stages : [])) {
response.push(doc)
}
}