From ecfff7bcb9e1f5580a9d898dfd151be1a018f170 Mon Sep 17 00:00:00 2001 From: Francis Asante Date: Wed, 4 Dec 2024 15:36:18 -0800 Subject: [PATCH] feat($type): Use 'regexp' as type name when strict mode is disabled --- CHANGELOG.md | 3 ++- README.md | 2 +- src/operators/expression/type/type.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee50bfb23..20482c2b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,9 @@ - Export default update function and factory in module index. - Improve performance of `$bucketAuto` by removing excessive hashing. - Simplify API for adding operators in Context class. -- Deprecate `updateObject(..)` in favour of `update(..)`. +- Renamed `updateObject(..)` to `update(..)`. - Remove optimistic string representation on custom type without explicit `toString()` method. +- Expression operator `$type` returns `"regexp"` instead of `"regex"` when `useStrictMode`=`false`. **Fixes** diff --git a/README.md b/README.md index 10564fbeb..ac74df3dd 100644 --- a/README.md +++ b/README.md @@ -212,7 +212,7 @@ Query and aggregation operations can be configured with options to enabled diffe | idKey | The key that is used to lookup the ID value of a document. | "\_id" | | | collation | [Collation](http://kofrasa.github.io/mingo/interfaces/core.CollationSpec.html) specification for string sorting operations. | _none_ | See [Intl.Collator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) | | processingMode | Determines copy rules for inputs and outputs. | [CLONE_OFF](http://kofrasa.github.io/mingo/enums/core.ProcessingMode.html) | Turn off cloning and modifies the input collection as needed.
This option will also return output objects with shared paths in their graph when specific operators are used. Provides the greatest speedup by minizing cloning. When using the aggregation pipeline, you can use the `$out` operator to collect immutable intermediate results. | -| useStrictMode | Enforces strict MongoDB compatibilty. | true | When disabled, behaviour changes as follows.