Skip to content

Commit d30e7be

Browse files
Copilothotlong
andcommitted
fix: Address code review comments
- Remove unnecessary Promise.resolve in connect method - Add fallback for aggregation function property Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent d5defca commit d30e7be

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/drivers/mongo/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export class MongoDriver implements Driver {
5555
*/
5656
async connect(): Promise<void> {
5757
await this.connected;
58-
return Promise.resolve();
5958
}
6059

6160
/**
@@ -238,7 +237,7 @@ export class MongoDriver implements Driver {
238237
if (normalized.aggregations !== undefined && normalized.aggregate === undefined) {
239238
// Convert QueryAST aggregations format to legacy aggregate format
240239
normalized.aggregate = normalized.aggregations.map((agg: any) => ({
241-
func: agg.function,
240+
func: agg.function || agg.func,
242241
field: agg.field,
243242
alias: agg.alias
244243
}));

0 commit comments

Comments
 (0)