@valkey/valkey-glide-darwin-arm64 1.2.0 → 1.2.1-rc0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-ts/src/BaseClient.d.ts +27 -1
- package/build-ts/src/BaseClient.js +9 -1
- package/build-ts/src/BaseClient.js.map +1 -1
- package/build-ts/src/Commands.d.ts +12 -0
- package/build-ts/src/Commands.js.map +1 -1
- package/build-ts/src/GlideClient.d.ts +17 -1
- package/build-ts/src/GlideClient.js +3 -0
- package/build-ts/src/GlideClient.js.map +1 -1
- package/build-ts/src/GlideClusterClient.d.ts +23 -7
- package/build-ts/src/GlideClusterClient.js +8 -3
- package/build-ts/src/GlideClusterClient.js.map +1 -1
- package/build-ts/src/ProtobufMessage.js +46 -1
- package/build-ts/src/ProtobufMessage.js.map +1 -1
- package/node_modules/glide-rs/glide-rs.darwin-arm64.node +0 -0
- package/node_modules/glide-rs/index.d.ts +2 -1
- package/node_modules/glide-rs/index.js +4 -2
- package/npm/glide/index.ts +4 -3
- package/npm/glide/package.json +0 -1
- package/package.json +2 -2
- package/rust-client/node_modules/mingo/README.md +58 -53
- package/rust-client/node_modules/mingo/dist/cjs/aggregator.js +18 -20
- package/rust-client/node_modules/mingo/dist/cjs/core.js +179 -190
- package/rust-client/node_modules/mingo/dist/cjs/cursor.js +34 -34
- package/rust-client/node_modules/mingo/dist/cjs/index.js +11 -3
- package/rust-client/node_modules/mingo/dist/cjs/init/basic.js +4 -22
- package/rust-client/node_modules/mingo/dist/cjs/init/system.js +6 -6
- package/rust-client/node_modules/mingo/dist/cjs/lazy.js +58 -61
- package/rust-client/node_modules/mingo/dist/cjs/operators/_predicates.js +12 -25
- package/rust-client/node_modules/mingo/dist/cjs/operators/accumulator/_internal.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/accumulator/accumulator.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/accumulator/first.js +3 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/accumulator/last.js +4 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/accumulator/max.js +9 -6
- package/rust-client/node_modules/mingo/dist/cjs/operators/accumulator/mergeObjects.js +5 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/accumulator/min.js +9 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/accumulator/push.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/accumulator/sum.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/add.js +9 -10
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/ceil.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/exp.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/floor.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/ln.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/log.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/log10.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/round.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/sqrt.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/subtract.js +5 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/arithmetic/trunc.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/arrayElemAt.js +2 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/arrayToObject.js +3 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/concatArrays.js +11 -5
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/filter.js +1 -0
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/first.js +8 -8
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/firstN.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/in.js +1 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/indexOfArray.js +5 -10
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/isArray.js +2 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/last.js +8 -8
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/lastN.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/map.js +1 -0
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/maxN.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/minN.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/reduce.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/reverseArray.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/sortArray.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/array/zip.js +4 -10
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/bitwise/_internal.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/bitwise/bitNot.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/boolean/not.js +3 -5
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/comparison/cmp.js +6 -5
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/conditional/cond.js +1 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/conditional/ifNull.js +1 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/conditional/switch.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/_internal.js +157 -65
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/dateAdd.js +1 -29
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/dateDiff.js +32 -20
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/dateFromParts.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/dateFromString.js +13 -9
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/dateToString.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/dateTrunc.js +107 -0
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/dayOfYear.js +1 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/index.js +2 -0
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/isoWeekYear.js +1 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/date/week.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/misc/getField.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/object/mergeObjects.js +9 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/object/objectToArray.js +5 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/object/setField.js +11 -7
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/set/setDifference.js +9 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/set/setEquals.js +17 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/set/setIntersection.js +2 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/set/setIsSubset.js +15 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/set/setUnion.js +4 -5
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/string/_internal.js +4 -8
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/string/concat.js +5 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/string/indexOfBytes.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/string/replaceAll.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/string/replaceOne.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/string/split.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/string/strcasecmp.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/string/substr.js +4 -14
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/string/substrBytes.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/trignometry/atan2.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/trignometry/cosh.js +0 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/type/_internal.js +20 -10
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/type/convert.js +3 -5
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/type/toBool.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/type/toDate.js +3 -6
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/type/toDouble.js +5 -10
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/type/toInt.js +1 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/type/toLong.js +1 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/type/toString.js +11 -10
- package/rust-client/node_modules/mingo/dist/cjs/operators/expression/type/type.js +11 -14
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/addFields.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/bucket.js +53 -53
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/bucketAuto.js +670 -65
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/count.js +2 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/densify.js +196 -0
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/graphLookup.js +78 -0
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/group.js +6 -9
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/index.js +4 -0
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/limit.js +1 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/lookup.js +47 -10
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/merge.js +7 -13
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/out.js +1 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/project.js +19 -38
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/redact.js +3 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/replaceWith.js +9 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/sample.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/setWindowFields.js +10 -20
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/skip.js +1 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/sort.js +10 -19
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/sortByCount.js +5 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/unionWith.js +1 -1
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/unset.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/pipeline/unwind.js +5 -9
- package/rust-client/node_modules/mingo/dist/cjs/operators/projection/elemMatch.js +2 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/projection/slice.js +2 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/query/bitwise/_internal.js +4 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/_internal.js +8 -14
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/addToSet.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/bit.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/max.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/min.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/pop.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/pull.js +2 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/push.js +3 -9
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/rename.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/set.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/update/unset.js +1 -2
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/_internal.js +2 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/denseRank.js +8 -10
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/derivative.js +4 -6
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/documentNumber.js +1 -3
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/expMovingAvg.js +4 -6
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/integral.js +3 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/linearFill.js +4 -6
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/locf.js +3 -4
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/rank.js +8 -10
- package/rust-client/node_modules/mingo/dist/cjs/operators/window/shift.js +2 -2
- package/rust-client/node_modules/mingo/dist/cjs/query.js +20 -19
- package/rust-client/node_modules/mingo/dist/cjs/types.js +22 -0
- package/rust-client/node_modules/mingo/dist/cjs/updater.js +6 -5
- package/rust-client/node_modules/mingo/dist/cjs/util.js +265 -388
- package/rust-client/node_modules/mingo/dist/esm/aggregator.js +18 -21
- package/rust-client/node_modules/mingo/dist/esm/core.js +179 -192
- package/rust-client/node_modules/mingo/dist/esm/cursor.js +35 -35
- package/rust-client/node_modules/mingo/dist/esm/index.js +8 -2
- package/rust-client/node_modules/mingo/dist/esm/init/basic.js +5 -12
- package/rust-client/node_modules/mingo/dist/esm/init/system.js +7 -7
- package/rust-client/node_modules/mingo/dist/esm/lazy.js +58 -61
- package/rust-client/node_modules/mingo/dist/esm/operators/_predicates.js +14 -32
- package/rust-client/node_modules/mingo/dist/esm/operators/accumulator/_internal.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/accumulator/accumulator.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/accumulator/first.js +7 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/accumulator/last.js +8 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/accumulator/max.js +10 -7
- package/rust-client/node_modules/mingo/dist/esm/operators/accumulator/mergeObjects.js +5 -1
- package/rust-client/node_modules/mingo/dist/esm/operators/accumulator/min.js +10 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/accumulator/push.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/accumulator/sum.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/add.js +9 -10
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/ceil.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/exp.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/floor.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/ln.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/log.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/log10.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/round.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/sqrt.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/subtract.js +5 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/arithmetic/trunc.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/arrayElemAt.js +3 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/arrayToObject.js +3 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/concatArrays.js +12 -6
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/filter.js +2 -1
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/first.js +10 -13
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/firstN.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/in.js +1 -1
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/indexOfArray.js +5 -10
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/isArray.js +2 -3
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/last.js +10 -13
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/lastN.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/map.js +2 -1
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/maxN.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/minN.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/reduce.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/reverseArray.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/sortArray.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/array/zip.js +4 -10
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/bitwise/_internal.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/bitwise/bitNot.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/boolean/not.js +4 -6
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/comparison/cmp.js +6 -5
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/conditional/cond.js +2 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/conditional/ifNull.js +1 -1
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/conditional/switch.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/_internal.js +140 -61
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/dateAdd.js +2 -35
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/dateDiff.js +43 -21
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/dateFromParts.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/dateFromString.js +13 -11
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/dateToString.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/dateTrunc.js +97 -0
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/dayOfYear.js +2 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/index.js +1 -0
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/isoWeekYear.js +2 -5
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/date/week.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/misc/getField.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/object/mergeObjects.js +10 -3
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/object/objectToArray.js +6 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/object/setField.js +11 -7
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/set/setDifference.js +10 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/set/setEquals.js +18 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/set/setIntersection.js +3 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/set/setIsSubset.js +16 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/set/setUnion.js +5 -6
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/string/_internal.js +4 -8
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/string/concat.js +6 -3
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/string/indexOfBytes.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/string/replaceAll.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/string/replaceOne.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/string/split.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/string/strcasecmp.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/string/substr.js +4 -14
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/string/substrBytes.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/trignometry/atan2.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/trignometry/cosh.js +0 -1
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/type/_internal.js +17 -11
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/type/convert.js +3 -5
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/type/toBool.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/type/toDate.js +4 -7
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/type/toDouble.js +6 -11
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/type/toInt.js +2 -5
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/type/toLong.js +2 -5
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/type/toString.js +12 -11
- package/rust-client/node_modules/mingo/dist/esm/operators/expression/type/type.js +12 -15
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/addFields.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/bucket.js +54 -61
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/bucketAuto.js +679 -66
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/count.js +3 -3
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/densify.js +183 -0
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/graphLookup.js +55 -0
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/group.js +6 -9
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/index.js +2 -0
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/limit.js +1 -3
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/lookup.js +55 -11
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/merge.js +9 -14
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/out.js +2 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/project.js +21 -42
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/redact.js +3 -1
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/replaceWith.js +9 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/sample.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/setWindowFields.js +12 -23
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/skip.js +1 -1
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/sort.js +11 -20
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/sortByCount.js +5 -3
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/unionWith.js +2 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/unset.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/pipeline/unwind.js +6 -9
- package/rust-client/node_modules/mingo/dist/esm/operators/projection/elemMatch.js +3 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/projection/slice.js +2 -3
- package/rust-client/node_modules/mingo/dist/esm/operators/query/bitwise/_internal.js +4 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/update/_internal.js +9 -14
- package/rust-client/node_modules/mingo/dist/esm/operators/update/addToSet.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/update/bit.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/update/max.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/update/min.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/update/pop.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/update/pull.js +2 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/update/push.js +3 -9
- package/rust-client/node_modules/mingo/dist/esm/operators/update/rename.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/update/set.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/update/unset.js +1 -2
- package/rust-client/node_modules/mingo/dist/esm/operators/window/_internal.js +2 -3
- package/rust-client/node_modules/mingo/dist/esm/operators/window/denseRank.js +8 -10
- package/rust-client/node_modules/mingo/dist/esm/operators/window/derivative.js +4 -6
- package/rust-client/node_modules/mingo/dist/esm/operators/window/documentNumber.js +1 -3
- package/rust-client/node_modules/mingo/dist/esm/operators/window/expMovingAvg.js +4 -6
- package/rust-client/node_modules/mingo/dist/esm/operators/window/integral.js +3 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/window/linearFill.js +4 -6
- package/rust-client/node_modules/mingo/dist/esm/operators/window/locf.js +3 -4
- package/rust-client/node_modules/mingo/dist/esm/operators/window/rank.js +8 -10
- package/rust-client/node_modules/mingo/dist/esm/operators/window/shift.js +2 -2
- package/rust-client/node_modules/mingo/dist/esm/query.js +22 -32
- package/rust-client/node_modules/mingo/dist/esm/types.js +14 -0
- package/rust-client/node_modules/mingo/dist/esm/updater.js +5 -5
- package/rust-client/node_modules/mingo/dist/esm/util.js +263 -377
- package/rust-client/node_modules/mingo/dist/types/aggregator.d.ts +7 -9
- package/rust-client/node_modules/mingo/dist/types/core.d.ts +41 -52
- package/rust-client/node_modules/mingo/dist/types/cursor.d.ts +6 -12
- package/rust-client/node_modules/mingo/dist/types/index.d.ts +8 -4
- package/rust-client/node_modules/mingo/dist/types/init/basic.d.ts +1 -6
- package/rust-client/node_modules/mingo/dist/types/lazy.d.ts +19 -15
- package/rust-client/node_modules/mingo/dist/types/operators/_predicates.d.ts +20 -20
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/accumulator.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/addToSet.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/avg.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/bottom.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/bottomN.d.ts +4 -4
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/count.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/covariancePop.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/covarianceSamp.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/first.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/firstN.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/last.d.ts +4 -4
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/lastN.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/max.d.ts +4 -5
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/maxN.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/mergeObjects.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/min.d.ts +4 -5
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/minN.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/percentile.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/push.d.ts +4 -4
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/stdDevPop.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/stdDevSamp.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/sum.d.ts +5 -3
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/top.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/accumulator/topN.d.ts +4 -4
- package/rust-client/node_modules/mingo/dist/types/operators/expression/arithmetic/add.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/arithmetic/multiply.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/arithmetic/pow.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/arithmetic/subtract.d.ts +1 -0
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/arrayElemAt.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/concatArrays.d.ts +3 -3
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/filter.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/first.d.ts +0 -4
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/firstN.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/in.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/indexOfArray.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/isArray.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/last.d.ts +0 -4
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/lastN.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/map.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/maxN.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/minN.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/range.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/reduce.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/reverseArray.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/array/slice.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/date/_internal.d.ts +31 -9
- package/rust-client/node_modules/mingo/dist/types/operators/expression/date/dateFromString.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/expression/date/dateToParts.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/expression/date/dateTrunc.d.ts +12 -0
- package/rust-client/node_modules/mingo/dist/types/operators/expression/date/index.d.ts +1 -0
- package/rust-client/node_modules/mingo/dist/types/operators/expression/misc/rand.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/expression/object/mergeObjects.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/expression/percentile.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/set/setIsSubset.d.ts +3 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/string/_internal.d.ts +4 -4
- package/rust-client/node_modules/mingo/dist/types/operators/expression/string/indexOfBytes.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/string/replaceAll.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/string/replaceOne.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/string/split.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/string/strLenBytes.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/string/strLenCP.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/expression/string/substrBytes.d.ts +2 -0
- package/rust-client/node_modules/mingo/dist/types/operators/expression/type/_internal.d.ts +6 -2
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/_internal.d.ts +4 -4
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/addFields.d.ts +8 -5
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/bucket.d.ts +8 -5
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/bucketAuto.d.ts +8 -7
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/count.d.ts +7 -5
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/densify.d.ts +12 -0
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/facet.d.ts +7 -1
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/fill.d.ts +6 -3
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/graphLookup.d.ts +13 -0
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/group.d.ts +4 -2
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/index.d.ts +2 -0
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/limit.d.ts +3 -1
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/lookup.d.ts +4 -2
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/match.d.ts +4 -3
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/merge.d.ts +3 -5
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/out.d.ts +5 -3
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/project.d.ts +4 -3
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/redact.d.ts +1 -1
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/replaceRoot.d.ts +5 -5
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/replaceWith.d.ts +8 -1
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/sample.d.ts +7 -5
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/setWindowFields.d.ts +7 -5
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/skip.d.ts +6 -4
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/sort.d.ts +5 -3
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/sortByCount.d.ts +5 -5
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/unionWith.d.ts +3 -1
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/unset.d.ts +2 -0
- package/rust-client/node_modules/mingo/dist/types/operators/pipeline/unwind.d.ts +5 -2
- package/rust-client/node_modules/mingo/dist/types/operators/query/evaluation/expr.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/query/evaluation/jsonSchema.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/query/evaluation/where.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/_internal.d.ts +5 -5
- package/rust-client/node_modules/mingo/dist/types/operators/update/addToSet.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/bit.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/currentDate.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/inc.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/max.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/min.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/mul.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/pop.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/pull.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/pullAll.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/push.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/rename.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/set.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/update/unset.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/window/_internal.d.ts +5 -5
- package/rust-client/node_modules/mingo/dist/types/operators/window/denseRank.d.ts +2 -3
- package/rust-client/node_modules/mingo/dist/types/operators/window/derivative.d.ts +2 -3
- package/rust-client/node_modules/mingo/dist/types/operators/window/documentNumber.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/window/expMovingAvg.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/window/integral.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/window/linearFill.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/window/locf.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/window/rank.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/operators/window/shift.d.ts +2 -2
- package/rust-client/node_modules/mingo/dist/types/query.d.ts +5 -7
- package/rust-client/node_modules/mingo/dist/types/types.d.ts +18 -15
- package/rust-client/node_modules/mingo/dist/types/updater.d.ts +9 -10
- package/rust-client/node_modules/mingo/dist/types/util.d.ts +102 -90
- package/rust-client/node_modules/mingo/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Options } from "./core";
|
|
2
2
|
import { Iterator, Source } from "./lazy";
|
|
3
|
-
import {
|
|
3
|
+
import { AnyObject } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* Provides functionality for the mongoDB aggregation pipeline
|
|
6
6
|
*
|
|
@@ -9,21 +9,19 @@ import { RawObject } from "./types";
|
|
|
9
9
|
* @constructor
|
|
10
10
|
*/
|
|
11
11
|
export declare class Aggregator {
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
constructor(pipeline: Array<RawObject>, options?: Partial<Options>);
|
|
12
|
+
#private;
|
|
13
|
+
constructor(pipeline: AnyObject[], options?: Partial<Options>);
|
|
15
14
|
/**
|
|
16
|
-
* Returns an
|
|
15
|
+
* Returns an {@link Iterator} for lazy evaluation of the pipeline.
|
|
17
16
|
*
|
|
18
17
|
* @param {*} collection An array or iterator object
|
|
19
18
|
* @returns {Iterator} an iterator object
|
|
20
19
|
*/
|
|
21
|
-
stream(collection: Source): Iterator;
|
|
20
|
+
stream(collection: Source, options?: Options): Iterator;
|
|
22
21
|
/**
|
|
23
22
|
* Return the results of the aggregation as an array.
|
|
24
23
|
*
|
|
25
|
-
* @param
|
|
26
|
-
* @param {*} query
|
|
24
|
+
* @param collection
|
|
27
25
|
*/
|
|
28
|
-
run<T extends
|
|
26
|
+
run<T extends AnyObject>(collection: Source, options?: Options): T[];
|
|
29
27
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Iterator } from "./lazy";
|
|
2
|
-
import {
|
|
2
|
+
import { Any, AnyObject, Callback, HashFunction, Predicate, WindowOperatorInput } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Resolves the given string to a Collection.
|
|
5
5
|
* This is useful for operators that require a second collection to use such as $lookup and $out.
|
|
6
6
|
* The collection is not cached and will be resolved each time it is used.
|
|
7
7
|
*/
|
|
8
|
-
export type CollectionResolver = (name: string) =>
|
|
8
|
+
export type CollectionResolver = (name: string) => AnyObject[];
|
|
9
9
|
/** Specification for collation options */
|
|
10
10
|
export interface CollationSpec {
|
|
11
11
|
readonly locale: string;
|
|
@@ -20,7 +20,7 @@ export interface CollationSpec {
|
|
|
20
20
|
/**
|
|
21
21
|
* JSON schema validator
|
|
22
22
|
*/
|
|
23
|
-
export type JsonSchemaValidator = (schema:
|
|
23
|
+
export type JsonSchemaValidator = (schema: AnyObject) => Predicate<AnyObject>;
|
|
24
24
|
/**
|
|
25
25
|
* This controls how input and output documents are processed to meet different application needs.
|
|
26
26
|
* Each mode has different trade offs for; immutability, reference sharing, and performance.
|
|
@@ -78,24 +78,19 @@ export interface Options {
|
|
|
78
78
|
/** JSON schema validator to use with the '$jsonSchema' operator. Required in order to use the operator. */
|
|
79
79
|
readonly jsonSchemaValidator?: JsonSchemaValidator;
|
|
80
80
|
/** Global variables. */
|
|
81
|
-
readonly variables?: Readonly<
|
|
81
|
+
readonly variables?: Readonly<AnyObject>;
|
|
82
82
|
/** Extra references to operators to be used for processing. */
|
|
83
83
|
readonly context: Context;
|
|
84
84
|
}
|
|
85
85
|
interface LocalData {
|
|
86
86
|
/** The groupId computed for a group of documents. */
|
|
87
|
-
readonly groupId?:
|
|
87
|
+
readonly groupId?: Any;
|
|
88
88
|
/** Local user-defind variables. */
|
|
89
|
-
readonly variables?:
|
|
89
|
+
readonly variables?: AnyObject;
|
|
90
90
|
}
|
|
91
91
|
/** Custom type to facilitate type checking for global options */
|
|
92
92
|
export declare class ComputeOptions implements Options {
|
|
93
|
-
private
|
|
94
|
-
/** Reference to the root object when processing subgraphs of the object. */
|
|
95
|
-
private _root;
|
|
96
|
-
private _local?;
|
|
97
|
-
/** The current time in milliseconds. Remains the same throughout all stages of the aggregation pipeline. */
|
|
98
|
-
readonly timestamp: number;
|
|
93
|
+
#private;
|
|
99
94
|
private constructor();
|
|
100
95
|
/**
|
|
101
96
|
* Initialize new ComputeOptions.
|
|
@@ -105,9 +100,15 @@ export declare class ComputeOptions implements Options {
|
|
|
105
100
|
* @param local
|
|
106
101
|
* @returns {ComputeOptions}
|
|
107
102
|
*/
|
|
108
|
-
static init(options: Options, root?:
|
|
109
|
-
/**
|
|
110
|
-
|
|
103
|
+
static init(options: Options, root?: Any, local?: LocalData): ComputeOptions;
|
|
104
|
+
/**
|
|
105
|
+
* Updates the internal state.
|
|
106
|
+
*
|
|
107
|
+
* @param root The new root context for this object.
|
|
108
|
+
* @param local The new local state to merge into current if it exists.
|
|
109
|
+
* @returns
|
|
110
|
+
*/
|
|
111
|
+
update(root?: Any, local?: LocalData): ComputeOptions;
|
|
111
112
|
getOptions(): Options;
|
|
112
113
|
get root(): unknown;
|
|
113
114
|
get local(): LocalData;
|
|
@@ -120,14 +121,14 @@ export declare class ComputeOptions implements Options {
|
|
|
120
121
|
get hashFunction(): HashFunction;
|
|
121
122
|
get collectionResolver(): CollectionResolver;
|
|
122
123
|
get jsonSchemaValidator(): JsonSchemaValidator;
|
|
123
|
-
get variables(): Readonly<
|
|
124
|
+
get variables(): Readonly<AnyObject>;
|
|
124
125
|
get context(): Context;
|
|
125
126
|
}
|
|
126
127
|
/**
|
|
127
128
|
* Creates an Option from another where required keys are initialized.
|
|
128
129
|
* @param options Options
|
|
129
130
|
*/
|
|
130
|
-
export declare function initOptions(options
|
|
131
|
+
export declare function initOptions(options?: Partial<Options>): Options;
|
|
131
132
|
/**
|
|
132
133
|
* Supported cloning modes.
|
|
133
134
|
* - "deep": Performs a recursive deep clone of the object.
|
|
@@ -152,63 +153,51 @@ export declare enum OperatorType {
|
|
|
152
153
|
QUERY = "query",
|
|
153
154
|
WINDOW = "window"
|
|
154
155
|
}
|
|
155
|
-
export type AccumulatorOperator<R =
|
|
156
|
-
export type ExpressionOperator<R =
|
|
157
|
-
export type PipelineOperator = (collection: Iterator, expr:
|
|
158
|
-
export type ProjectionOperator = (obj:
|
|
159
|
-
export type QueryOperator = (selector: string, value:
|
|
160
|
-
export type WindowOperator = (obj:
|
|
156
|
+
export type AccumulatorOperator<R = Any> = (collection: Any[], expr: Any, options: Options) => R;
|
|
157
|
+
export type ExpressionOperator<R = Any> = (obj: AnyObject, expr: Any, options: Options) => R;
|
|
158
|
+
export type PipelineOperator = (collection: Iterator, expr: Any, options: Options) => Iterator;
|
|
159
|
+
export type ProjectionOperator = (obj: AnyObject, expr: Any, selector: string, options: Options) => Any;
|
|
160
|
+
export type QueryOperator = (selector: string, value: Any, options: Options) => (obj: AnyObject) => boolean;
|
|
161
|
+
export type WindowOperator = (obj: AnyObject, array: AnyObject[], expr: WindowOperatorInput, options: Options) => Any;
|
|
161
162
|
/** Interface for update operators */
|
|
162
|
-
export type UpdateOperator = (obj:
|
|
163
|
-
|
|
164
|
-
/** Map of operator functions */
|
|
165
|
-
export type OperatorMap = Record<string, Operator>;
|
|
166
|
-
type ContextMap = Partial<{
|
|
167
|
-
[OperatorType.ACCUMULATOR]: Record<string, AccumulatorOperator>;
|
|
168
|
-
[OperatorType.EXPRESSION]: Record<string, ExpressionOperator>;
|
|
169
|
-
[OperatorType.PIPELINE]: Record<string, PipelineOperator>;
|
|
170
|
-
[OperatorType.PROJECTION]: Record<string, ProjectionOperator>;
|
|
171
|
-
[OperatorType.QUERY]: Record<string, QueryOperator>;
|
|
172
|
-
[OperatorType.WINDOW]: Record<string, WindowOperator>;
|
|
173
|
-
}>;
|
|
163
|
+
export type UpdateOperator = (obj: AnyObject, expr: AnyObject, arrayFilters: AnyObject[], options: UpdateOptions) => string[];
|
|
164
|
+
type Operator = AccumulatorOperator | ExpressionOperator | PipelineOperator | ProjectionOperator | QueryOperator | WindowOperator;
|
|
174
165
|
type AccumulatorOps = Record<string, AccumulatorOperator>;
|
|
175
166
|
type ExpressionOps = Record<string, ExpressionOperator>;
|
|
176
167
|
type ProjectionOps = Record<string, ProjectionOperator>;
|
|
177
168
|
type QueryOps = Record<string, QueryOperator>;
|
|
178
169
|
type PipelineOps = Record<string, PipelineOperator>;
|
|
179
170
|
type WindowOps = Record<string, WindowOperator>;
|
|
171
|
+
/** Kinds of operators that can be registered. */
|
|
172
|
+
export type OpType = "accumulator" | "expression" | "pipeline" | "projection" | "query" | "window";
|
|
180
173
|
export declare class Context {
|
|
181
|
-
private
|
|
174
|
+
#private;
|
|
182
175
|
private constructor();
|
|
183
|
-
static init(
|
|
184
|
-
static from(ctx
|
|
176
|
+
static init(): Context;
|
|
177
|
+
static from(ctx?: Context): Context;
|
|
185
178
|
private addOperators;
|
|
179
|
+
getOperator(type: OpType, name: string): Callback | null;
|
|
186
180
|
addAccumulatorOps(ops: AccumulatorOps): Context;
|
|
187
181
|
addExpressionOps(ops: ExpressionOps): Context;
|
|
188
182
|
addQueryOps(ops: QueryOps): Context;
|
|
189
183
|
addPipelineOps(ops: PipelineOps): Context;
|
|
190
184
|
addProjectionOps(ops: ProjectionOps): Context;
|
|
191
185
|
addWindowOps(ops: WindowOps): Context;
|
|
192
|
-
getOperator(type: OperatorType, name: string): Callback | null;
|
|
193
186
|
}
|
|
194
187
|
/**
|
|
195
|
-
* Register
|
|
196
|
-
*
|
|
197
|
-
* @param type The operator type
|
|
198
|
-
* @param operators Map of the operators
|
|
199
|
-
*/
|
|
200
|
-
export declare function useOperators(type: OperatorType, operators: OperatorMap): void;
|
|
201
|
-
/**
|
|
202
|
-
* Overrides the current global context with this new one.
|
|
188
|
+
* Register global operators that are available when {@link Options.useGlobalContext} is enabled.
|
|
203
189
|
*
|
|
204
|
-
* @param
|
|
190
|
+
* @param type Operator type
|
|
191
|
+
* @param operators Map of operator name to functions
|
|
205
192
|
*/
|
|
193
|
+
export declare function useOperators(type: OpType, operators: Record<string, Operator>): void;
|
|
206
194
|
/**
|
|
207
195
|
* Returns the operator function or undefined if it is not found
|
|
208
196
|
* @param type Type of operator
|
|
209
|
-
* @param
|
|
197
|
+
* @param name Name of the operator
|
|
198
|
+
* @param options
|
|
210
199
|
*/
|
|
211
|
-
export declare function getOperator(type:
|
|
200
|
+
export declare function getOperator(type: OpType, name: string, options: Pick<Options, "useGlobalContext" | "context">): Operator;
|
|
212
201
|
/**
|
|
213
202
|
* Computes the value of the expression on the object for the given operator
|
|
214
203
|
*
|
|
@@ -218,7 +207,7 @@ export declare function getOperator(type: OperatorType, operator: string, option
|
|
|
218
207
|
* @param options {Object} extra options
|
|
219
208
|
* @returns {*}
|
|
220
209
|
*/
|
|
221
|
-
export declare function computeValue(obj:
|
|
210
|
+
export declare function computeValue(obj: Any, expr: Any, operator: string | null, options?: Options): Any;
|
|
222
211
|
/**
|
|
223
212
|
* Redact an object
|
|
224
213
|
* @param {Object} obj The object to redact
|
|
@@ -226,5 +215,5 @@ export declare function computeValue(obj: AnyVal, expr: AnyVal, operator: string
|
|
|
226
215
|
* @param {*} options Options for value
|
|
227
216
|
* @return {*} returns the result of the redacted object
|
|
228
217
|
*/
|
|
229
|
-
export declare function redact(obj:
|
|
218
|
+
export declare function redact(obj: AnyObject, expr: Any, options: ComputeOptions): Any;
|
|
230
219
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollationSpec, Options } from "./core";
|
|
2
2
|
import { Iterator, Source } from "./lazy";
|
|
3
|
-
import {
|
|
3
|
+
import { Any, AnyObject, Callback, Predicate } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* Cursor to iterate and perform filtering on matched objects.
|
|
6
6
|
* This object must not be used directly. A cursor may be obtaine from calling `find()` on an instance of `Query`.
|
|
@@ -12,14 +12,8 @@ import { AnyVal, Callback, Predicate, RawObject } from "./types";
|
|
|
12
12
|
* @constructor
|
|
13
13
|
*/
|
|
14
14
|
export declare class Cursor<T> {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
readonly projection: RawObject;
|
|
18
|
-
private options?;
|
|
19
|
-
private readonly operators;
|
|
20
|
-
private result;
|
|
21
|
-
private buffer;
|
|
22
|
-
constructor(source: Source, predicate: Predicate<AnyVal>, projection: RawObject, options?: Options);
|
|
15
|
+
#private;
|
|
16
|
+
constructor(source: Source, predicate: Predicate<Any>, projection: AnyObject, options?: Options);
|
|
23
17
|
/** Returns the iterator from running the query */
|
|
24
18
|
private fetch;
|
|
25
19
|
/** Returns an iterator with the buffered data included */
|
|
@@ -48,10 +42,10 @@ export declare class Cursor<T> {
|
|
|
48
42
|
limit(n: number): Cursor<T>;
|
|
49
43
|
/**
|
|
50
44
|
* Returns results ordered according to a sort specification.
|
|
51
|
-
* @param {
|
|
45
|
+
* @param {AnyObject} modifier an object of key and values specifying the sort order. 1 for ascending and -1 for descending
|
|
52
46
|
* @return {Cursor} Returns the cursor, so you can chain this call.
|
|
53
47
|
*/
|
|
54
|
-
sort(modifier:
|
|
48
|
+
sort(modifier: AnyObject): Cursor<T>;
|
|
55
49
|
/**
|
|
56
50
|
* Specifies the collation for the cursor returned by the `mingo.Query.find`
|
|
57
51
|
* @param {*} spec
|
|
@@ -59,7 +53,7 @@ export declare class Cursor<T> {
|
|
|
59
53
|
collation(spec: CollationSpec): Cursor<T>;
|
|
60
54
|
/**
|
|
61
55
|
* Returns the next document in a cursor.
|
|
62
|
-
* @returns {
|
|
56
|
+
* @returns {AnyObject | Boolean}
|
|
63
57
|
*/
|
|
64
58
|
next(): T;
|
|
65
59
|
/**
|
|
@@ -4,9 +4,11 @@ import { Options } from "./core";
|
|
|
4
4
|
import { Cursor } from "./cursor";
|
|
5
5
|
import { Source } from "./lazy";
|
|
6
6
|
import { Query } from "./query";
|
|
7
|
-
import {
|
|
7
|
+
import { AnyObject } from "./types";
|
|
8
|
+
import { createUpdater } from "./updater";
|
|
8
9
|
export { Aggregator } from "./aggregator";
|
|
9
10
|
export { Query } from "./query";
|
|
11
|
+
export { createUpdater, update } from "./updater";
|
|
10
12
|
/**
|
|
11
13
|
* Performs a query on a collection and returns a cursor object.
|
|
12
14
|
* Shorthand for `Query(criteria).find(collection, projection)`
|
|
@@ -17,7 +19,7 @@ export { Query } from "./query";
|
|
|
17
19
|
* @param options
|
|
18
20
|
* @returns {Cursor} A cursor of results
|
|
19
21
|
*/
|
|
20
|
-
export declare function find<T>(collection: Source, criteria:
|
|
22
|
+
export declare function find<T>(collection: Source, criteria: AnyObject, projection?: AnyObject, options?: Partial<Options>): Cursor<T>;
|
|
21
23
|
/**
|
|
22
24
|
* Returns a new array without objects which match the criteria
|
|
23
25
|
*
|
|
@@ -26,7 +28,7 @@ export declare function find<T>(collection: Source, criteria: RawObject, project
|
|
|
26
28
|
* @param options
|
|
27
29
|
* @returns {Array} New filtered array
|
|
28
30
|
*/
|
|
29
|
-
export declare function remove(collection:
|
|
31
|
+
export declare function remove(collection: AnyObject[], criteria: AnyObject, options?: Options): AnyObject[];
|
|
30
32
|
/**
|
|
31
33
|
* Return the result collection after running the aggregation pipeline for the given collection.
|
|
32
34
|
* Shorthand for `(new Aggregator(pipeline, options)).run(collection)`
|
|
@@ -36,12 +38,14 @@ export declare function remove(collection: RawObject[], criteria: RawObject, opt
|
|
|
36
38
|
* @param options
|
|
37
39
|
* @returns {Array} New array of results
|
|
38
40
|
*/
|
|
39
|
-
export declare function aggregate(collection: Source, pipeline:
|
|
41
|
+
export declare function aggregate(collection: Source, pipeline: AnyObject[], options?: Partial<Options>): AnyObject[];
|
|
40
42
|
declare const _default: {
|
|
41
43
|
Aggregator: typeof Aggregator;
|
|
42
44
|
Query: typeof Query;
|
|
43
45
|
aggregate: typeof aggregate;
|
|
46
|
+
createUpdater: typeof createUpdater;
|
|
44
47
|
find: typeof find;
|
|
45
48
|
remove: typeof remove;
|
|
49
|
+
update: import("./updater").Updater;
|
|
46
50
|
};
|
|
47
51
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Any, Callback, Predicate } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* A value produced by a generator
|
|
4
4
|
*/
|
|
5
|
-
interface IteratorResult {
|
|
6
|
-
readonly value?:
|
|
5
|
+
export interface IteratorResult<T = Any> {
|
|
6
|
+
readonly value?: T;
|
|
7
7
|
readonly done: boolean;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -12,20 +12,24 @@ interface IteratorResult {
|
|
|
12
12
|
interface Generator<T> {
|
|
13
13
|
next: () => T;
|
|
14
14
|
}
|
|
15
|
-
export type Source = Generator<IteratorResult> | Callback<IteratorResult> |
|
|
15
|
+
export type Source = Generator<IteratorResult> | Callback<IteratorResult> | Any[];
|
|
16
16
|
/**
|
|
17
17
|
* Returns an iterator
|
|
18
18
|
* @param {*} source An iterable source (Array, Function, Generator, or Iterator)
|
|
19
19
|
*/
|
|
20
20
|
export declare function Lazy(source: Source): Iterator;
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Concatenate multiple iterators and return a new iterator.
|
|
23
|
+
*
|
|
24
|
+
* @param iterators The iterators to concatenate
|
|
25
|
+
* @returns {Iterator} A new iterator
|
|
26
|
+
*/
|
|
27
|
+
export declare function concat(...iterators: Iterator[]): Iterator;
|
|
22
28
|
/**
|
|
23
29
|
* A lazy collection iterator yields a single value at a time upon request.
|
|
24
30
|
*/
|
|
25
31
|
export declare class Iterator {
|
|
26
|
-
private
|
|
27
|
-
private readonly yieldedValues;
|
|
28
|
-
private getNext;
|
|
32
|
+
#private;
|
|
29
33
|
private isDone;
|
|
30
34
|
/**
|
|
31
35
|
* @param {*} source An iterable object or function.
|
|
@@ -39,17 +43,17 @@ export declare class Iterator {
|
|
|
39
43
|
* Add an iteratee to this lazy sequence
|
|
40
44
|
*/
|
|
41
45
|
private push;
|
|
42
|
-
next(): IteratorResult
|
|
46
|
+
next<T = Any>(): IteratorResult<T>;
|
|
43
47
|
/**
|
|
44
48
|
* Transform each item in the sequence to a new value
|
|
45
49
|
* @param {Function} f
|
|
46
50
|
*/
|
|
47
|
-
map<T =
|
|
51
|
+
map<T = Any>(f: Callback<T>): Iterator;
|
|
48
52
|
/**
|
|
49
53
|
* Select only items matching the given predicate
|
|
50
54
|
* @param {Function} pred
|
|
51
55
|
*/
|
|
52
|
-
filter<T =
|
|
56
|
+
filter<T = Any>(predicate: Predicate<T>): Iterator;
|
|
53
57
|
/**
|
|
54
58
|
* Take given numbe for values from sequence
|
|
55
59
|
* @param {Number} n A number greater than 0
|
|
@@ -64,9 +68,9 @@ export declare class Iterator {
|
|
|
64
68
|
* Returns a new lazy object with results of the transformation
|
|
65
69
|
* The entire sequence is realized.
|
|
66
70
|
*
|
|
67
|
-
* @param {Callback<Source,
|
|
71
|
+
* @param {Callback<Source, Any[]>} fn Tranform function of type (Array) => (Any)
|
|
68
72
|
*/
|
|
69
|
-
transform(fn: Callback<Source,
|
|
73
|
+
transform(fn: Callback<Source, Any[]>): Iterator;
|
|
70
74
|
/**
|
|
71
75
|
* Returns the fully realized values of the iterators.
|
|
72
76
|
* The return value will be an array unless `lazy.first()` was used.
|
|
@@ -78,14 +82,14 @@ export declare class Iterator {
|
|
|
78
82
|
* @param {Function} f
|
|
79
83
|
* @returns {Boolean} false iff `f` return false for AnyVal execution, otherwise true
|
|
80
84
|
*/
|
|
81
|
-
each<T =
|
|
85
|
+
each<T = Any>(f: Callback<T>): boolean;
|
|
82
86
|
/**
|
|
83
87
|
* Returns the reduction of sequence according the reducing function
|
|
84
88
|
*
|
|
85
89
|
* @param {*} f a reducing function
|
|
86
90
|
* @param {*} initialValue
|
|
87
91
|
*/
|
|
88
|
-
reduce<T =
|
|
92
|
+
reduce<T = Any>(f: Callback<T>, initialValue?: Any): T;
|
|
89
93
|
/**
|
|
90
94
|
* Returns the number of matched items in the sequence
|
|
91
95
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Predicates used for Query and Expression operators.
|
|
3
3
|
*/
|
|
4
4
|
import { ExpressionOperator, Options, QueryOperator } from "../core";
|
|
5
|
-
import {
|
|
5
|
+
import { Any, AnyObject, BsonType, JsType, Predicate } from "../types";
|
|
6
6
|
type PredicateOptions = Options & {
|
|
7
7
|
depth: number;
|
|
8
8
|
};
|
|
@@ -12,13 +12,13 @@ type ConversionType = number | JsType | BsonType;
|
|
|
12
12
|
*
|
|
13
13
|
* @param predicate Predicate function
|
|
14
14
|
*/
|
|
15
|
-
export declare function createQueryOperator(predicate: Predicate<
|
|
15
|
+
export declare function createQueryOperator(predicate: Predicate<Any>): QueryOperator;
|
|
16
16
|
/**
|
|
17
17
|
* Returns an expression operator created from the predicate
|
|
18
18
|
*
|
|
19
19
|
* @param predicate Predicate function
|
|
20
20
|
*/
|
|
21
|
-
export declare function createExpressionOperator(predicate: Predicate<
|
|
21
|
+
export declare function createExpressionOperator(predicate: Predicate<Any>): ExpressionOperator;
|
|
22
22
|
/**
|
|
23
23
|
* Checks that two values are equal.
|
|
24
24
|
*
|
|
@@ -26,7 +26,7 @@ export declare function createExpressionOperator(predicate: Predicate<AnyVal>):
|
|
|
26
26
|
* @param b The rhs operand provided by the user
|
|
27
27
|
* @returns {*}
|
|
28
28
|
*/
|
|
29
|
-
export declare function $eq(a:
|
|
29
|
+
export declare function $eq(a: Any, b: Any, options?: PredicateOptions): boolean;
|
|
30
30
|
/**
|
|
31
31
|
* Matches all values that are not equal to the value specified in the query.
|
|
32
32
|
*
|
|
@@ -34,7 +34,7 @@ export declare function $eq(a: AnyVal, b: AnyVal, options?: PredicateOptions): b
|
|
|
34
34
|
* @param b
|
|
35
35
|
* @returns {boolean}
|
|
36
36
|
*/
|
|
37
|
-
export declare function $ne(a:
|
|
37
|
+
export declare function $ne(a: Any, b: Any, options?: PredicateOptions): boolean;
|
|
38
38
|
/**
|
|
39
39
|
* Matches any of the values that exist in an array specified in the query.
|
|
40
40
|
*
|
|
@@ -42,7 +42,7 @@ export declare function $ne(a: AnyVal, b: AnyVal, options?: PredicateOptions): b
|
|
|
42
42
|
* @param b
|
|
43
43
|
* @returns {*}
|
|
44
44
|
*/
|
|
45
|
-
export declare function $in(a:
|
|
45
|
+
export declare function $in(a: Any[], b: Any[], options?: PredicateOptions): boolean;
|
|
46
46
|
/**
|
|
47
47
|
* Matches values that do not exist in an array specified to the query.
|
|
48
48
|
*
|
|
@@ -50,7 +50,7 @@ export declare function $in(a: RawArray, b: RawArray, options?: PredicateOptions
|
|
|
50
50
|
* @param b
|
|
51
51
|
* @returns {*|boolean}
|
|
52
52
|
*/
|
|
53
|
-
export declare function $nin(a:
|
|
53
|
+
export declare function $nin(a: Any[], b: Any[], options?: PredicateOptions): boolean;
|
|
54
54
|
/**
|
|
55
55
|
* Matches values that are less than the value specified in the query.
|
|
56
56
|
*
|
|
@@ -58,7 +58,7 @@ export declare function $nin(a: RawArray, b: RawArray, options?: PredicateOption
|
|
|
58
58
|
* @param b
|
|
59
59
|
* @returns {boolean}
|
|
60
60
|
*/
|
|
61
|
-
export declare function $lt(a:
|
|
61
|
+
export declare function $lt(a: Any, b: Any, _options?: PredicateOptions): boolean;
|
|
62
62
|
/**
|
|
63
63
|
* Matches values that are less than or equal to the value specified in the query.
|
|
64
64
|
*
|
|
@@ -66,7 +66,7 @@ export declare function $lt(a: AnyVal, b: AnyVal, _options?: PredicateOptions):
|
|
|
66
66
|
* @param b
|
|
67
67
|
* @returns {boolean}
|
|
68
68
|
*/
|
|
69
|
-
export declare function $lte(a:
|
|
69
|
+
export declare function $lte(a: Any, b: Any, _options?: PredicateOptions): boolean;
|
|
70
70
|
/**
|
|
71
71
|
* Matches values that are greater than the value specified in the query.
|
|
72
72
|
*
|
|
@@ -74,7 +74,7 @@ export declare function $lte(a: AnyVal, b: AnyVal, _options?: PredicateOptions):
|
|
|
74
74
|
* @param b
|
|
75
75
|
* @returns {boolean}
|
|
76
76
|
*/
|
|
77
|
-
export declare function $gt(a:
|
|
77
|
+
export declare function $gt(a: Any, b: Any, _options?: PredicateOptions): boolean;
|
|
78
78
|
/**
|
|
79
79
|
* Matches values that are greater than or equal to the value specified in the query.
|
|
80
80
|
*
|
|
@@ -82,7 +82,7 @@ export declare function $gt(a: AnyVal, b: AnyVal, _options?: PredicateOptions):
|
|
|
82
82
|
* @param b
|
|
83
83
|
* @returns {boolean}
|
|
84
84
|
*/
|
|
85
|
-
export declare function $gte(a:
|
|
85
|
+
export declare function $gte(a: Any, b: Any, _options?: PredicateOptions): boolean;
|
|
86
86
|
/**
|
|
87
87
|
* Performs a modulo operation on the value of a field and selects documents with a specified result.
|
|
88
88
|
*
|
|
@@ -90,7 +90,7 @@ export declare function $gte(a: AnyVal, b: AnyVal, _options?: PredicateOptions):
|
|
|
90
90
|
* @param b
|
|
91
91
|
* @returns {boolean}
|
|
92
92
|
*/
|
|
93
|
-
export declare function $mod(a:
|
|
93
|
+
export declare function $mod(a: Any, b: number[], _options?: PredicateOptions): boolean;
|
|
94
94
|
/**
|
|
95
95
|
* Selects documents where values match a specified regular expression.
|
|
96
96
|
*
|
|
@@ -98,7 +98,7 @@ export declare function $mod(a: AnyVal, b: number[], _options?: PredicateOptions
|
|
|
98
98
|
* @param b
|
|
99
99
|
* @returns {boolean}
|
|
100
100
|
*/
|
|
101
|
-
export declare function $regex(a:
|
|
101
|
+
export declare function $regex(a: Any, b: RegExp, options?: PredicateOptions): boolean;
|
|
102
102
|
/**
|
|
103
103
|
* Matches documents that have the specified field.
|
|
104
104
|
*
|
|
@@ -106,7 +106,7 @@ export declare function $regex(a: AnyVal, b: RegExp, options?: PredicateOptions)
|
|
|
106
106
|
* @param b
|
|
107
107
|
* @returns {boolean}
|
|
108
108
|
*/
|
|
109
|
-
export declare function $exists(a:
|
|
109
|
+
export declare function $exists(a: Any, b: Any, _options?: PredicateOptions): boolean;
|
|
110
110
|
/**
|
|
111
111
|
* Matches arrays that contain all elements specified in the query.
|
|
112
112
|
*
|
|
@@ -114,7 +114,7 @@ export declare function $exists(a: AnyVal, b: AnyVal, _options?: PredicateOption
|
|
|
114
114
|
* @param queries
|
|
115
115
|
* @returns boolean
|
|
116
116
|
*/
|
|
117
|
-
export declare function $all(values:
|
|
117
|
+
export declare function $all(values: Any[], queries: AnyObject[], options?: PredicateOptions): boolean;
|
|
118
118
|
/**
|
|
119
119
|
* Selects documents if the array field is a specified size.
|
|
120
120
|
*
|
|
@@ -122,14 +122,14 @@ export declare function $all(values: RawArray, queries: Array<RawObject>, option
|
|
|
122
122
|
* @param b
|
|
123
123
|
* @returns {*|boolean}
|
|
124
124
|
*/
|
|
125
|
-
export declare function $size(a:
|
|
125
|
+
export declare function $size(a: Any[], b: number, _options?: PredicateOptions): boolean;
|
|
126
126
|
/**
|
|
127
127
|
* Selects documents if element in the array field matches all the specified $elemMatch condition.
|
|
128
128
|
*
|
|
129
|
-
* @param a {
|
|
130
|
-
* @param b {
|
|
129
|
+
* @param a {Any[]} element to match against
|
|
130
|
+
* @param b {AnyObject} subquery
|
|
131
131
|
*/
|
|
132
|
-
export declare function $elemMatch(a:
|
|
132
|
+
export declare function $elemMatch(a: Any[], b: AnyObject, options?: PredicateOptions): boolean;
|
|
133
133
|
/**
|
|
134
134
|
* Selects documents if a field is of the specified type.
|
|
135
135
|
*
|
|
@@ -137,5 +137,5 @@ export declare function $elemMatch(a: RawArray, b: RawObject, options?: Predicat
|
|
|
137
137
|
* @param b
|
|
138
138
|
* @returns {boolean}
|
|
139
139
|
*/
|
|
140
|
-
export declare function $type(a:
|
|
140
|
+
export declare function $type(a: Any, b: ConversionType | ConversionType[], options?: PredicateOptions): boolean;
|
|
141
141
|
export {};
|
|
@@ -2,7 +2,7 @@ import { AccumulatorOperator } from "../../core";
|
|
|
2
2
|
/**
|
|
3
3
|
* Defines a custom accumulator function.
|
|
4
4
|
*
|
|
5
|
-
* @param {
|
|
5
|
+
* @param {Any[]} collection The input array
|
|
6
6
|
* @param {*} expr The expression for the operator
|
|
7
7
|
* @param {Options} options Options
|
|
8
8
|
*/
|
|
@@ -3,7 +3,7 @@ import { AccumulatorOperator } from "../../core";
|
|
|
3
3
|
* Returns an array of all the unique values for the selected field among for each document in that group.
|
|
4
4
|
*
|
|
5
5
|
* @param {Array} collection The input array
|
|
6
|
-
* @param {
|
|
6
|
+
* @param {AnyObject} expr The right-hand side expression value of the operator
|
|
7
7
|
* @param {Options} options The options to use for this operation
|
|
8
8
|
* @returns {*}
|
|
9
9
|
*/
|
|
@@ -3,7 +3,7 @@ import { AccumulatorOperator } from "../../core";
|
|
|
3
3
|
* Returns an average of all the values in a group.
|
|
4
4
|
*
|
|
5
5
|
* @param {Array} collection The input array
|
|
6
|
-
* @param {
|
|
6
|
+
* @param {AnyObject} expr The right-hand side expression value of the operator
|
|
7
7
|
* @param {Options} options The options to use for this operation
|
|
8
8
|
* @returns {Number}
|
|
9
9
|
*/
|
|
@@ -2,8 +2,8 @@ import { AccumulatorOperator } from "../../core";
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns the bottom element within a group according to the specified sort order.
|
|
4
4
|
*
|
|
5
|
-
* @param {
|
|
6
|
-
* @param {
|
|
5
|
+
* @param {Any[]} collection The input array
|
|
6
|
+
* @param {AnyObject} expr The right-hand side expression value of the operator
|
|
7
7
|
* @param {Options} options The options to use for this operation
|
|
8
8
|
* @returns {*}
|
|
9
9
|
*/
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AccumulatorOperator } from "../../core";
|
|
2
|
-
import {
|
|
2
|
+
import { Any } from "../../types";
|
|
3
3
|
/**
|
|
4
4
|
* Returns an aggregation of the bottom n elements within a group, according to the specified sort order.
|
|
5
5
|
* If the group contains fewer than n elements, $bottomN returns all elements in the group.
|
|
6
6
|
*
|
|
7
|
-
* @param {
|
|
8
|
-
* @param {
|
|
7
|
+
* @param {Any[]} collection The input array
|
|
8
|
+
* @param {AnyObject} expr The right-hand side expression value of the operator
|
|
9
9
|
* @param {Options} options The options to use for this operation
|
|
10
10
|
* @returns {*}
|
|
11
11
|
*/
|
|
12
|
-
export declare const $bottomN: AccumulatorOperator<
|
|
12
|
+
export declare const $bottomN: AccumulatorOperator<Any[]>;
|
|
@@ -3,7 +3,7 @@ import { AccumulatorOperator } from "../../core";
|
|
|
3
3
|
* Returns the number of documents in the group or window.
|
|
4
4
|
*
|
|
5
5
|
* @param {Array} collection The input array
|
|
6
|
-
* @param {
|
|
6
|
+
* @param {AnyObject} expr The right-hand side expression value of the operator
|
|
7
7
|
* @returns {*}
|
|
8
8
|
*/
|
|
9
9
|
export declare const $count: AccumulatorOperator;
|
|
@@ -2,7 +2,7 @@ import { AccumulatorOperator } from "../../core";
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns the population covariance of two numeric expressions.
|
|
4
4
|
* @param {Array} collection
|
|
5
|
-
* @param {
|
|
5
|
+
* @param {AnyObject} expr
|
|
6
6
|
* @return {Number|null}
|
|
7
7
|
*/
|
|
8
8
|
export declare const $covariancePop: AccumulatorOperator;
|