Skip to content

Commit

Permalink
fix(mongo): fix support for ignoreUndefinedInQuery
Browse files Browse the repository at this point in the history
Closes #4891
  • Loading branch information
B4nan committed Nov 2, 2023
1 parent f887e77 commit cef26c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export class Utils {
return o.forEach((item: unknown) => Utils.dropUndefinedProperties(item, value, visited));
}

if (!Utils.isObject(o) || visited.has(o)) {
if (!Utils.isPlainObject(o) || visited.has(o)) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions tests/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export async function initORMMongo(replicaSet = false) {
filters: { allowedFooBars: { cond: args => ({ id: { $in: args.allowed } }), entity: ['FooBar'], default: false } },
pool: { min: 1, max: 3 },
migrations: { path: BASE_DIR + '/../temp/migrations-mongo' },
ignoreUndefinedInQuery: true,
});

ensureIndexes = false;
Expand Down

0 comments on commit cef26c5

Please sign in to comment.