Skip to content

Commit

Permalink
fix: edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
Hieuzest committed Aug 27, 2023
1 parent f391934 commit a942e4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mongo/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ export class Transformer {
private transformEvalExpr(expr: any, group?: Dict) {
// https://jira.mongodb.org/browse/SERVER-54046
// mongo supports empty object in $set from 6.1.0/7.0.0
if (Object.keys(expr).length === 0 && expr.constructor === Object) {
return { $literal: {} }
if (Object.keys(expr).length === 0) {
return { $literal: expr }
}

if (expr.$) {
Expand Down

0 comments on commit a942e4c

Please sign in to comment.