Fixes
- Support BigInt only when available on platform #407
New
- Add support for accumulator and expression operators;
$percentile
,$median
.
Fixes
- Minor refactoring improvements to fix build issues in some web frameworks.
New
- Add support for bitwise aggregation operators.
$bitAnd
,$bitOr
,$bitXor
,$bitNot
. - Add support for typed arrays in
isEqual
,cloneDeep
, andstringify
.
Fixes
- Build object graph for relevant update operators
$inc
,$mul
,$max
,$min
,$push
,$bit
. - Compare user-defined types with referential equality only with
isEqual
. - Process user-defined types correctly with
stringify
. - Properly handle cycles in
stringify
operation.
Fixes
- Support nested object query expressions for
$pull
. 373
Fixes
- Allow specifying only field expression for
$getField
operator. - Make place argument optional for
$trunc
and$round
. 347 - Add and default to new clone mode
copy
for UpdateOptions. - Remove clone mode
structured
for UpdateOptions.
Fixes
- Fixed incorrect query normalization when a regex condition is specified as an object literal. 355
- Restore generic type annotations for top-level classes. 357
Fixes
- Fix rounding of even whole numbers. 347
New
- Add
Context
to enable isolated configurations of usable operators in the same runtime context.
New
- Add options support for
updateObject
. - Add
createUpdater
for creating updater functions with default options. - Default to no cloning of inputs to update operators.
- Provide clone method configuration via
cloneMode
option.
New
- Added support for update operators accessible via
updateObject
frommingo/updater
. Includes;- Field Update Operators:
$currentDate
,$inc
,$max
,$min
,$mul
,$set
,$unset
,$rename
. - Array Update Operators:
$[]
,$[<identifier>]
,$addToSet
,$pop
,$push
,$pull
,$pushAll
. - Bitwise Update Operators:
$bit
.
- Field Update Operators:
Fixes
- Fixed hash collision resolution for
$sort
and$group
. Closes 332. - Support MongoDB compatibility truth check for
$where
operator.
Minor
- Export
walk
util function. - Flatten module exports to expose only
index
roots. - Update dependencies.
- Deprecated due to invalid operator imports.
Fixes
- Coerce empty string
""
totrue
for applicable operators when using strict MongoDB compatibility mode. 321
Fixes
- Fix
$filter
to properly handle truthy values. 320 - Fix
$arrayToObject
to flatten array before converting to objects.
Fixes
- Fix
$size
predicate failing when applied to undefined array. 313 - Fix
$min
and$max
operators to consider type sorting order. - Fix
$group
operator to enforce_id
in spec. - Fix variable propagation from parent to child expressions. 315
- Fix missing validations for
$setWindowFields
operator.
New
- Add support for
$locf
window operator. - Add support for
$linearFill
window operator. - Add support for
$fill
pipeline operator.
Fixes
- Ensure all variables are accessible in their local contexts. Closes 302
Fixes
- Ensure all variables are accessible in their local contexts. Closes 302
Fixes
- ADD .json files to package.json files array (#299)
Fixes
- Include
package.json
in explicit module exports. - Create
package.json
files for subpackages to support all ESM bundlers (#298)
Fixes
- Export all module paths explicitly for CommonJS and ES6 formats. Closes 295.
- Distribute package for both commongJS and as ES6 module.
Fixes
- Properly bind
$$this
when resolving fields using array operators. Closes 289
New
- Added array expression operators;
$maxN
,$minN
,$firstN
,$lastN
, and$sortArray
. - Added accumulator operators;
$maxN
,$minN
,$first
,$firstN
,$last
,$lastN
,$top
,$topN
,$bottom
, and$bottomN
. - Added trignometry operators;
$cosh
and$sinh
.
Fixes
- Correclt handle boundary values for trignometry functions.
- Nested arrays are projected correctly when excluded in results.
- Support MongoDB comparison sort order by data type.
Fixes
- Use correct context for resolving paths. Closes 284
- Support user-defined global variables.
Fixes
- Fix breaking change in
6.1.1
. Closes 274 - Fix
$dateToString
formatter%V
to be week of year in ISO 8601 format (i.e.01
-53
) - Fix
$dateToString
formatter%u
to be day of week number in ISO 8601 format (i.e.1
-7
) - Add
$dateToString
formatter%U
for week of year.
Fixes
- Handle timezone correctly for
$dateToParts
. Closes #256
Fixes
- Allow multiple expressions to
$ifNull
conditional.
New
- Added
$dateDiff
operator. See #244
Fixes
- Correctly handle comparison of multiple deeply nested arrays. Fixes #238
Fixes
- Handle timezone letters for
$dateFromString
. Fixes #228
Fixes
- Handle hash collisions to correct behaviour of set operators;
setEqual
,$setIntersection
,$setIsSubset
, and$setUnion
. - Support arbitrary number of arrays in
$setIntersection
.
Fixes
- Remove use of
console.assert
. See #226 - Remove deprecated
mingo/init
import.
Fixes
- Fix incorrect date bug when handling underflows in
dateFromParts
. See #224
Fixes
- Fixed bug in
$dateFromParts
which incorrectly computes the dates for some input values. See #223.
New
- Add option
processingMode
to control input and output behaviour. - Add option
scriptEnabled
to control whether to enable custom function operators;$where
,$function
, and$accumulator
. - Add new operator type
OperatorType.WINDOW
. - Add aggregation expression operators;
$accumulator
$function
$getField
$setField
$unsetField
$sampleRate
$replaceOne
$replaceAll
- Add pipeline operators.
$setWindowFields
$merge
$unionWith
- Add window operators for
$setWindowFields
.$denseRank
$derivative
$documentNumber
$expMovingAvg
$integral
$rank
$shift
- Add accumulator operators.
$count
$covarianceSamp
$covariancePop
- Add support for
$$NOW
system variable. - Add ISO date operators.
$isoWeek
$isoWeekYear
$isoDayOfWeek
- Add support for
iso8601
option to$dateToParts
. - Add
useStrictMode
option to enable useful non-standard behaviour on specific operators.- The
$elemMatch
projection operator return all matching nested documents instead whenuseStrictMode
isfalse
.
- The
Removed
- Removed support for string function body in
$where
operator. - Remove
addOperators
function. - Removed
Collection
type.
Fixes
- Fixed computation bug in
$dateAdd
and$dateSubtract
operators. - Fix bug in
sortBy
which causes duplicate values. - Fix ranking for duplicate values for
$denseRank
operator. - Fix cursor navigation bugs.
- Fix timezone handling in
$dateToString
operator. - Return list of single item for
$count
aggregation operator.
Changes not published. Updates moved to 6.0.0
.
Changes not published. Updates moved to 6.0.0
.
Fixes
- Remove
lodash
reference in expression operators.
Features
- Add bitwise query operators.
$bitsAllClear
$bitsAllSet
$bitsAnyClear
$bitsAnySet
.
- Add
$jsonSchema
query operator.
Features
- Add
$rand
aggregation and query operator
Fixes
- Support arbitrary input expressions for date operators
- Use hash function for deep-equality check in
union
function
- Add array operators
$first
and$last
. - Add date operators
$dateAdd
and$dateSubtract
.
- Use context object in
$filter
.
- Add stronger type definitions for custom operators.
- Convert unit tests to Typescript.
- Update Typedocs.
- Fix
$unwind
incorrectly removing0
value, by correcting behaviour ofisEmpty
- Fix
$elemMatch
to support top-level boolean operators$and
,$or
, and$nor
Features
- Added trignometry operators.
$sin
$cos
$tan
$asin
$acos
$atan
$atan2
$asinh
$acosh
$atanh
$degreesToRadians
$radiansToDegrees
Features
- Added option
hashFunction
to enable custom hash functions - Added
$unset
pipeline operator - Added
$isNumber
expression operator - Added option
collectionResolver
to resolve collections from names for use in supported operators. Closes #150 - Removed
$where
operator from default query operators included at load time. Closes #155 Fixes - Support object type names with integer characters Other
- Improved type annotations
- Added ES lint to ensure code quality
- Added Prettier to maintain consistent code format
- Fix
isObject
to enforce plain Javascript objects. - Fix
collation
options of$sort
operator - Merge
Config
intoOptions
type - Pass
Options
to predicate function for comparison operators - Replace
createConfig
withmakeOptions
- Fix $bucket default and boundaries mutation. Fixes #147
- Handle empty array values to
$not
expression operator.
- Handle non-array values to
$not
expression operator. Fixes #146
- Deprecate
mingo/init
in favour of explicitmingo/init/basic
.
- Remove
esm
module dependency. Fixes #145
$map
operator operand 'as', should default tothis
if missing. Fixes #143
- Throw exception for specifying unregistered operators
- Fix regression bug in
$elemMatch
. Closes #139
- Convert project to Typescript
- Build ES6 libraries with support for selective import
- Default export only
Aggregator
,Query
,aggregate()
,find()
, andremove()
- Auto load only Query and Projection operators in main module via
mingo/init
- Provide module
mingo/init/system
to auto load all operators - Expose library via
esm
dependency to support module imports for ES5 - Implement type operators
$type
,$convert
,$toBool
,$toDate
,$toString
,$toInt
,$toLong
,$toDouble
,$toDecimal
- Implement date operators
$dateFromString
,$dateFromParts
,dateToParts
. - Implement string operators
$trim
,$rtrim
,$ltrim
,$regexFind
,$regexFindAll
,$regexMatch
- Add timezone support for all date operators
- Return all date operator results in UTC
- Split large expression operator groups to file per operator
- Rename
group
module toaccumulator
- Removed
dist/
files. Deferring to consumers to use their own packaging solutions - Removed
setup()
function. Replaced by passing in config toQuery
orAggregator
. - Removed
VERSION
fields - Removed
_internal()
- Pass only
computeValue
andresolve
functions to custom operator - Deprecate and replace
OP_XXX
constants with enumOperatorType.XXX
. - Removed
CollectionMixin
- Removed
Lazy
,Cursor
, andaddOperators
from default export - Support extra options parameter on all operator functions
- Revert to using
dist/mingo.js
as main entry point for package. Fixes #125 - Fix build failures from updated dependencies
- Create minified files for previous version
- Refactored to support tree shaking
- Optionally add
Symbol.iterator
support if available in runtime environment. Closes #124 - Allow matching with nested fields in $lookup. Fixes #123
- Add $round operator and support 'place' argument for
$trunc
. Fixes #121 - Support new array fields. Fixes #119
- Handle embedded document exclusions
- Do not enforce single value for
$facet
aggregation pipeline operations. Fixes #110
- Add $set as $addFields alias. Fixes #113
- Fix $group operator idempotency issue. #82 (#114)
- Use renovateapp for dependency version management
- Correctly project and merge nested objects with missing keys.
- Properly flatten projected nested objects. Fixes #105
- Improve sort performance
- Fix sorting non-string values when collation is enabled.
- Correctly handle subqueries for
$elemMatch
. Fixes #103
- Add support for collation on
Cursor
objects. Fixes #100
- Avoid resolving primitive type operands.
- Work around iOS 9 Safari compatibility problem (#98)
- Fixing typing for aggregator.run, make query optional. (#102)
- Minor cleanup and refactoring
- Correct changelog date
- Switch
inArray
andnotInArray
to useArray.prototype.includes
for performance. Fixes #95
- Project all matched elements of nested array correctly. Fixes #93
- Match missing fields correctly with
$exists
- Update
mergeObjects
to handle more use cases.
- Fix merge objects to project subdocuments correctly. Fixes #91
- Add
$$REMOVE
support to conditionally exclude fields
- Match undefined fields with
$in: [null]
queries (#85)
- Support
$unwind
for arrays nested in objects. Fixes #80
- Added
$expr
operator. Fixes #79
- More Performance improvements for lazy evaluation
- Added
$mergeObjects
operator - Change
Lazy
to factory - Remove
Lazy
static methods exceptisIterator
- Use iterator input for Query
- Don't sort cursor modifiers
- Added new
Lazy
iterator to re-implementCursor
and pipeline operators - Added
Aggregator.stream
to obtain iterator for stream pipeline results - Removed
Cursor
methodsfirst()
andlast()
- Add typescript declaration. Fixes #75
- Handle date values in
$add
operator. Fixes #73
- Fix
map
so it does not breakcloneDeep
- Improve hash function
- Remove array size constraint on
$concatArrays
. #64 - Filter out empty values from collection. #65
- Fix false positive tests and
$substrBytes
. #66 $regex
should matched nested one level deep. #70
- Minimize cloning in pipeline operators
- Return new object for
$lookup
without mutating original. Fixes #59 and #60 - Make
clone
return shallow clone - Provide
cloneDeep
for deep cloning
- Removed custom polyfills
- Added
$strLenBytes
,$strLenCP
,$substrCP
,$substrBytes
- Fix
$indexOfBytes
- Fix
$stdDevSamp
- Fix
$in
for aggregation operations - Removed max and min cursor methods.
- Restrict custom query operator type
OP_QUERY
to return boolean only - Rename
OP_AGGREGATE
toOP_EXPRESSION
- Update
$unwind
to MongoDB 3.2 features
- Fix
computeValue
not overriding group operator keys after resolving expression - Added
$in
,$objectToArray
, and$arrayToObject
array aggregation operators
- Restore
setup
function. kofrasa#56
- Replaced core-js because it bloats compiled library by 10K i.e. ~24%
- Fix #55
- Support ES6 modules
- Fix matching null and missing values. kofrasa#54
- Improve comparing user-defined types
- Fix
$where
operator not executed last. kofrasa#50 - Fix matching nested arrays. kofrasa#51
- Added
$facet
and$bucket
operators - Added
$bucketAuto
operator without granularity support - Added string keys for
$type
operator - Added Cursor support for ES2015 Iterator Protocol
- Sort null/undefined values to front of sorted result
- Revert to operator names with format
Mingo.OP_<name>
- Optimize
$lookup
implementation - Avoid reversing original input to
$reverseArray
- Fix incorrect method call for ObjectProto
- Limit exposed util methods to type checking
- Renamed
Mingo.OP_<name>
functions toMingo.KEY_<name>
- Added pipeline stage operator (
$lookup
)
- Updated polyfills to fix failing build on older node versions
- Added array aggregation operators
(
$arrayElemAt
,$concatArrays
,$filter
,$indexOfArray
,$isArray
,$range
,$reverseArray
,$reduce
,$slice
,$zip
) - Added string aggregation operators (
$indexOfBytes
,$split
) - Added arithmetic aggregation operators (
$ceil
,$exp
,$floor
,$ln
,$log
,$log10
,$pow
,$sqrt
,$trunc
) - Added .editorconfig
- Pass utility functions to custom operator implementation
- Rename function to retrieve collection id to
idKey
in custom operators - Moved support for query projection streaming to a new package mingo-stream
- Fix resolving system variables with subpaths. See #41
- Added support for system variables (
$$ROOT
,$$CURRENT
) - Implemented more pipeline operators (
$redact
,$addFields
,$sample
,$sortByCount
,$count
,$replaceRoot
) - Added
$switch
conditional operator - Fixed
$ifNull
conditional operator - Allow use of
$in
and$nin
as aggregation comparison operators
- Fix querying deeply nested nested arrays and object equality matching. See #36
- Make this library zero-dependent
- Fix nested projections for objects and arrays. See #25
- Fix incorrect de-duping of Date types in $sort aggregate operator. See #23
- Support matching against user-defined types. See #22
- Fixed numeric aggregation over undefined values. See issues#21
- Fixed erroneous cloning of objects. See #20
- Fixed matching nested array fields without specifying index. See #19
- Added
VERSION
global field
- Added
$dateToString
aggregation operator
- Added support for extending operators via
Mingo.addOperators
- Added
bower.json
- Fixed grouping documents by an object key
- Fixed exclusive select projection not returning correct fields