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