@valkey/valkey-glide-darwin-arm64 1.2.0 → 1.2.1-rc1
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
|
@@ -21,81 +21,686 @@ __export(bucketAuto_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(bucketAuto_exports);
|
|
23
23
|
var import_core = require("../../core");
|
|
24
|
+
var import_lazy = require("../../lazy");
|
|
24
25
|
var import_util = require("../../util");
|
|
25
|
-
const ID_KEY = "_id";
|
|
26
26
|
const $bucketAuto = (collection, expr, options) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const {
|
|
28
|
+
buckets: bucketCount,
|
|
29
|
+
groupBy: groupByExpr,
|
|
30
|
+
output: optOutputExpr,
|
|
31
|
+
// Available only if the all groupBy values are numeric and none of them are NaN.
|
|
32
|
+
granularity
|
|
33
|
+
} = expr;
|
|
34
|
+
const outputExpr = optOutputExpr ?? { count: { $sum: 1 } };
|
|
30
35
|
(0, import_util.assert)(
|
|
31
36
|
bucketCount > 0,
|
|
32
|
-
|
|
37
|
+
`$bucketAuto: 'buckets' field must be greater than 0, but found: ${bucketCount}`
|
|
33
38
|
);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
39
|
+
if (granularity) {
|
|
40
|
+
(0, import_util.assert)(
|
|
41
|
+
/^POWERSOF2|1-2-5|E(6|12|24|48|96|192)|R(5|10|20|40|80)$/.test(
|
|
42
|
+
granularity
|
|
43
|
+
),
|
|
44
|
+
`$bucketAuto: invalid granularity '${granularity}'.`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const keyMap = /* @__PURE__ */ new Map();
|
|
48
|
+
const setKey = !granularity ? (o, k) => keyMap.set(o, k) : (_, _2) => {
|
|
49
|
+
};
|
|
50
|
+
const sorted = collection.map((o) => {
|
|
51
|
+
const k = (0, import_core.computeValue)(o, groupByExpr, null, options) ?? null;
|
|
52
|
+
(0, import_util.assert)(
|
|
53
|
+
!granularity || (0, import_util.isNumber)(k),
|
|
54
|
+
"$bucketAuto: groupBy values must be numeric when granularity is specified."
|
|
55
|
+
);
|
|
56
|
+
setKey(o, k ?? null);
|
|
57
|
+
return [k ?? null, o];
|
|
58
|
+
}).value();
|
|
59
|
+
sorted.sort((x, y) => {
|
|
60
|
+
if ((0, import_util.isNil)(x[0])) return -1;
|
|
61
|
+
if ((0, import_util.isNil)(y[0])) return 1;
|
|
62
|
+
return (0, import_util.compare)(x[0], y[0]);
|
|
63
|
+
});
|
|
64
|
+
let getNext;
|
|
65
|
+
if (!granularity) {
|
|
66
|
+
getNext = granularityDefault(sorted, bucketCount, keyMap);
|
|
67
|
+
} else if (granularity == "POWERSOF2") {
|
|
68
|
+
getNext = granularityPowerOfTwo(
|
|
69
|
+
sorted,
|
|
70
|
+
bucketCount
|
|
71
|
+
);
|
|
72
|
+
} else {
|
|
73
|
+
getNext = granularityPreferredSeries(
|
|
74
|
+
sorted,
|
|
75
|
+
bucketCount,
|
|
76
|
+
granularity
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
let terminate = false;
|
|
80
|
+
return (0, import_lazy.Lazy)(() => {
|
|
81
|
+
if (terminate) return { done: true };
|
|
82
|
+
const { min, max, bucket, done } = getNext();
|
|
83
|
+
terminate = done;
|
|
84
|
+
const outFields = (0, import_core.computeValue)(
|
|
85
|
+
bucket,
|
|
86
|
+
outputExpr,
|
|
87
|
+
null,
|
|
88
|
+
options
|
|
89
|
+
);
|
|
90
|
+
for (const [k, v] of Object.entries(outFields)) {
|
|
91
|
+
if ((0, import_util.isArray)(v)) outFields[k] = v.filter((v2) => v2 !== void 0);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
done: false,
|
|
95
|
+
value: {
|
|
96
|
+
...outFields,
|
|
97
|
+
_id: { min, max }
|
|
75
98
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
function granularityDefault(sorted, bucketCount, keyMap) {
|
|
103
|
+
const size = sorted.length;
|
|
104
|
+
const approxBucketSize = Math.max(1, Math.round(sorted.length / bucketCount));
|
|
105
|
+
let index = 0;
|
|
106
|
+
let nBuckets = 0;
|
|
107
|
+
return () => {
|
|
108
|
+
const isLastBucket = ++nBuckets == bucketCount;
|
|
109
|
+
const bucket = new Array();
|
|
110
|
+
while (index < size && (isLastBucket || bucket.length < approxBucketSize || index > 0 && (0, import_util.isEqual)(sorted[index - 1][0], sorted[index][0]))) {
|
|
111
|
+
bucket.push(sorted[index++][1]);
|
|
112
|
+
}
|
|
113
|
+
const min = keyMap.get(bucket[0]);
|
|
114
|
+
let max;
|
|
115
|
+
if (index < size) {
|
|
116
|
+
max = sorted[index][0];
|
|
117
|
+
} else {
|
|
118
|
+
max = keyMap.get(bucket[bucket.length - 1]);
|
|
119
|
+
}
|
|
120
|
+
(0, import_util.assert)(
|
|
121
|
+
(0, import_util.isNil)(max) || (0, import_util.isNil)(min) || min <= max,
|
|
122
|
+
`error: $bucketAuto boundary must be in order.`
|
|
123
|
+
);
|
|
124
|
+
return {
|
|
125
|
+
min,
|
|
126
|
+
max,
|
|
127
|
+
bucket,
|
|
128
|
+
done: index >= size
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function granularityPowerOfTwo(sorted, bucketCount) {
|
|
133
|
+
const size = sorted.length;
|
|
134
|
+
const approxBucketSize = Math.max(1, Math.round(sorted.length / bucketCount));
|
|
135
|
+
const roundUp2 = (n) => n === 0 ? 0 : 2 ** (Math.floor(Math.log2(n)) + 1);
|
|
136
|
+
let index = 0;
|
|
137
|
+
let min = 0;
|
|
138
|
+
let max = 0;
|
|
139
|
+
return () => {
|
|
140
|
+
const bucket = new Array();
|
|
141
|
+
const boundValue = roundUp2(max);
|
|
142
|
+
min = index > 0 ? max : 0;
|
|
143
|
+
while (bucket.length < approxBucketSize && index < size && (max === 0 || sorted[index][0] < boundValue)) {
|
|
144
|
+
bucket.push(sorted[index++][1]);
|
|
87
145
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
groupByExpr,
|
|
92
|
-
null,
|
|
93
|
-
options
|
|
94
|
-
);
|
|
146
|
+
max = max == 0 ? roundUp2(sorted[index - 1][0]) : boundValue;
|
|
147
|
+
while (index < size && sorted[index][0] < max) {
|
|
148
|
+
bucket.push(sorted[index++][1]);
|
|
95
149
|
}
|
|
96
|
-
return
|
|
150
|
+
return {
|
|
151
|
+
min,
|
|
152
|
+
max,
|
|
153
|
+
bucket,
|
|
154
|
+
done: index >= size
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
const PREFERRED_NUMBERS = Object.freeze({
|
|
159
|
+
// "Least rounded" Renard number series, taken from Wikipedia page on preferred
|
|
160
|
+
// numbers: https://en.wikipedia.org/wiki/Preferred_number#Renard_numbers
|
|
161
|
+
R5: [10, 16, 25, 40, 63],
|
|
162
|
+
R10: [100, 125, 160, 200, 250, 315, 400, 500, 630, 800],
|
|
163
|
+
R20: [
|
|
164
|
+
100,
|
|
165
|
+
112,
|
|
166
|
+
125,
|
|
167
|
+
140,
|
|
168
|
+
160,
|
|
169
|
+
180,
|
|
170
|
+
200,
|
|
171
|
+
224,
|
|
172
|
+
250,
|
|
173
|
+
280,
|
|
174
|
+
315,
|
|
175
|
+
355,
|
|
176
|
+
400,
|
|
177
|
+
450,
|
|
178
|
+
500,
|
|
179
|
+
560,
|
|
180
|
+
630,
|
|
181
|
+
710,
|
|
182
|
+
800,
|
|
183
|
+
900
|
|
184
|
+
],
|
|
185
|
+
R40: [
|
|
186
|
+
100,
|
|
187
|
+
106,
|
|
188
|
+
112,
|
|
189
|
+
118,
|
|
190
|
+
125,
|
|
191
|
+
132,
|
|
192
|
+
140,
|
|
193
|
+
150,
|
|
194
|
+
160,
|
|
195
|
+
170,
|
|
196
|
+
180,
|
|
197
|
+
190,
|
|
198
|
+
200,
|
|
199
|
+
212,
|
|
200
|
+
224,
|
|
201
|
+
236,
|
|
202
|
+
250,
|
|
203
|
+
265,
|
|
204
|
+
280,
|
|
205
|
+
300,
|
|
206
|
+
315,
|
|
207
|
+
355,
|
|
208
|
+
375,
|
|
209
|
+
400,
|
|
210
|
+
425,
|
|
211
|
+
450,
|
|
212
|
+
475,
|
|
213
|
+
500,
|
|
214
|
+
530,
|
|
215
|
+
560,
|
|
216
|
+
600,
|
|
217
|
+
630,
|
|
218
|
+
670,
|
|
219
|
+
710,
|
|
220
|
+
750,
|
|
221
|
+
800,
|
|
222
|
+
850,
|
|
223
|
+
900,
|
|
224
|
+
950
|
|
225
|
+
],
|
|
226
|
+
R80: [
|
|
227
|
+
103,
|
|
228
|
+
109,
|
|
229
|
+
115,
|
|
230
|
+
122,
|
|
231
|
+
128,
|
|
232
|
+
136,
|
|
233
|
+
145,
|
|
234
|
+
155,
|
|
235
|
+
165,
|
|
236
|
+
175,
|
|
237
|
+
185,
|
|
238
|
+
195,
|
|
239
|
+
206,
|
|
240
|
+
218,
|
|
241
|
+
230,
|
|
242
|
+
243,
|
|
243
|
+
258,
|
|
244
|
+
272,
|
|
245
|
+
290,
|
|
246
|
+
307,
|
|
247
|
+
325,
|
|
248
|
+
345,
|
|
249
|
+
365,
|
|
250
|
+
387,
|
|
251
|
+
412,
|
|
252
|
+
437,
|
|
253
|
+
462,
|
|
254
|
+
487,
|
|
255
|
+
515,
|
|
256
|
+
545,
|
|
257
|
+
575,
|
|
258
|
+
615,
|
|
259
|
+
650,
|
|
260
|
+
690,
|
|
261
|
+
730,
|
|
262
|
+
775,
|
|
263
|
+
825,
|
|
264
|
+
875,
|
|
265
|
+
925,
|
|
266
|
+
975
|
|
267
|
+
],
|
|
268
|
+
// https://en.wikipedia.org/wiki/Preferred_number#1-2-5_series
|
|
269
|
+
"1-2-5": [10, 20, 50],
|
|
270
|
+
// E series, taken from Wikipedia page on preferred numbers:
|
|
271
|
+
// https://en.wikipedia.org/wiki/Preferred_number#E_series
|
|
272
|
+
E6: [10, 15, 22, 33, 47, 68],
|
|
273
|
+
E12: [10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82],
|
|
274
|
+
E24: [
|
|
275
|
+
10,
|
|
276
|
+
11,
|
|
277
|
+
12,
|
|
278
|
+
13,
|
|
279
|
+
15,
|
|
280
|
+
16,
|
|
281
|
+
18,
|
|
282
|
+
20,
|
|
283
|
+
22,
|
|
284
|
+
24,
|
|
285
|
+
27,
|
|
286
|
+
30,
|
|
287
|
+
33,
|
|
288
|
+
36,
|
|
289
|
+
39,
|
|
290
|
+
43,
|
|
291
|
+
47,
|
|
292
|
+
51,
|
|
293
|
+
56,
|
|
294
|
+
62,
|
|
295
|
+
68,
|
|
296
|
+
75,
|
|
297
|
+
82,
|
|
298
|
+
91
|
|
299
|
+
],
|
|
300
|
+
E48: [
|
|
301
|
+
100,
|
|
302
|
+
105,
|
|
303
|
+
110,
|
|
304
|
+
115,
|
|
305
|
+
121,
|
|
306
|
+
127,
|
|
307
|
+
133,
|
|
308
|
+
140,
|
|
309
|
+
147,
|
|
310
|
+
154,
|
|
311
|
+
162,
|
|
312
|
+
169,
|
|
313
|
+
178,
|
|
314
|
+
187,
|
|
315
|
+
196,
|
|
316
|
+
205,
|
|
317
|
+
215,
|
|
318
|
+
226,
|
|
319
|
+
237,
|
|
320
|
+
249,
|
|
321
|
+
261,
|
|
322
|
+
274,
|
|
323
|
+
287,
|
|
324
|
+
301,
|
|
325
|
+
316,
|
|
326
|
+
332,
|
|
327
|
+
348,
|
|
328
|
+
365,
|
|
329
|
+
383,
|
|
330
|
+
402,
|
|
331
|
+
422,
|
|
332
|
+
442,
|
|
333
|
+
464,
|
|
334
|
+
487,
|
|
335
|
+
511,
|
|
336
|
+
536,
|
|
337
|
+
562,
|
|
338
|
+
590,
|
|
339
|
+
619,
|
|
340
|
+
649,
|
|
341
|
+
681,
|
|
342
|
+
715,
|
|
343
|
+
750,
|
|
344
|
+
787,
|
|
345
|
+
825,
|
|
346
|
+
866,
|
|
347
|
+
909,
|
|
348
|
+
953
|
|
349
|
+
],
|
|
350
|
+
E96: [
|
|
351
|
+
100,
|
|
352
|
+
102,
|
|
353
|
+
105,
|
|
354
|
+
107,
|
|
355
|
+
110,
|
|
356
|
+
113,
|
|
357
|
+
115,
|
|
358
|
+
118,
|
|
359
|
+
121,
|
|
360
|
+
124,
|
|
361
|
+
127,
|
|
362
|
+
130,
|
|
363
|
+
133,
|
|
364
|
+
137,
|
|
365
|
+
140,
|
|
366
|
+
143,
|
|
367
|
+
147,
|
|
368
|
+
150,
|
|
369
|
+
154,
|
|
370
|
+
158,
|
|
371
|
+
162,
|
|
372
|
+
165,
|
|
373
|
+
169,
|
|
374
|
+
174,
|
|
375
|
+
178,
|
|
376
|
+
182,
|
|
377
|
+
187,
|
|
378
|
+
191,
|
|
379
|
+
196,
|
|
380
|
+
200,
|
|
381
|
+
205,
|
|
382
|
+
210,
|
|
383
|
+
215,
|
|
384
|
+
221,
|
|
385
|
+
226,
|
|
386
|
+
232,
|
|
387
|
+
237,
|
|
388
|
+
243,
|
|
389
|
+
249,
|
|
390
|
+
255,
|
|
391
|
+
261,
|
|
392
|
+
267,
|
|
393
|
+
274,
|
|
394
|
+
280,
|
|
395
|
+
287,
|
|
396
|
+
294,
|
|
397
|
+
301,
|
|
398
|
+
309,
|
|
399
|
+
316,
|
|
400
|
+
324,
|
|
401
|
+
332,
|
|
402
|
+
340,
|
|
403
|
+
348,
|
|
404
|
+
357,
|
|
405
|
+
365,
|
|
406
|
+
374,
|
|
407
|
+
383,
|
|
408
|
+
392,
|
|
409
|
+
402,
|
|
410
|
+
412,
|
|
411
|
+
422,
|
|
412
|
+
432,
|
|
413
|
+
442,
|
|
414
|
+
453,
|
|
415
|
+
464,
|
|
416
|
+
475,
|
|
417
|
+
487,
|
|
418
|
+
499,
|
|
419
|
+
511,
|
|
420
|
+
523,
|
|
421
|
+
536,
|
|
422
|
+
549,
|
|
423
|
+
562,
|
|
424
|
+
576,
|
|
425
|
+
590,
|
|
426
|
+
604,
|
|
427
|
+
619,
|
|
428
|
+
634,
|
|
429
|
+
649,
|
|
430
|
+
665,
|
|
431
|
+
681,
|
|
432
|
+
698,
|
|
433
|
+
715,
|
|
434
|
+
732,
|
|
435
|
+
750,
|
|
436
|
+
768,
|
|
437
|
+
787,
|
|
438
|
+
806,
|
|
439
|
+
825,
|
|
440
|
+
845,
|
|
441
|
+
866,
|
|
442
|
+
887,
|
|
443
|
+
909,
|
|
444
|
+
931,
|
|
445
|
+
953,
|
|
446
|
+
976
|
|
447
|
+
],
|
|
448
|
+
E192: [
|
|
449
|
+
100,
|
|
450
|
+
101,
|
|
451
|
+
102,
|
|
452
|
+
104,
|
|
453
|
+
105,
|
|
454
|
+
106,
|
|
455
|
+
107,
|
|
456
|
+
109,
|
|
457
|
+
110,
|
|
458
|
+
111,
|
|
459
|
+
113,
|
|
460
|
+
114,
|
|
461
|
+
115,
|
|
462
|
+
117,
|
|
463
|
+
118,
|
|
464
|
+
120,
|
|
465
|
+
121,
|
|
466
|
+
123,
|
|
467
|
+
124,
|
|
468
|
+
126,
|
|
469
|
+
127,
|
|
470
|
+
129,
|
|
471
|
+
130,
|
|
472
|
+
132,
|
|
473
|
+
133,
|
|
474
|
+
135,
|
|
475
|
+
137,
|
|
476
|
+
138,
|
|
477
|
+
140,
|
|
478
|
+
142,
|
|
479
|
+
143,
|
|
480
|
+
145,
|
|
481
|
+
147,
|
|
482
|
+
149,
|
|
483
|
+
150,
|
|
484
|
+
152,
|
|
485
|
+
154,
|
|
486
|
+
156,
|
|
487
|
+
158,
|
|
488
|
+
160,
|
|
489
|
+
162,
|
|
490
|
+
164,
|
|
491
|
+
165,
|
|
492
|
+
167,
|
|
493
|
+
169,
|
|
494
|
+
172,
|
|
495
|
+
174,
|
|
496
|
+
176,
|
|
497
|
+
178,
|
|
498
|
+
180,
|
|
499
|
+
182,
|
|
500
|
+
184,
|
|
501
|
+
187,
|
|
502
|
+
189,
|
|
503
|
+
191,
|
|
504
|
+
193,
|
|
505
|
+
196,
|
|
506
|
+
198,
|
|
507
|
+
200,
|
|
508
|
+
203,
|
|
509
|
+
205,
|
|
510
|
+
208,
|
|
511
|
+
210,
|
|
512
|
+
213,
|
|
513
|
+
215,
|
|
514
|
+
218,
|
|
515
|
+
221,
|
|
516
|
+
223,
|
|
517
|
+
226,
|
|
518
|
+
229,
|
|
519
|
+
232,
|
|
520
|
+
234,
|
|
521
|
+
237,
|
|
522
|
+
240,
|
|
523
|
+
243,
|
|
524
|
+
246,
|
|
525
|
+
249,
|
|
526
|
+
252,
|
|
527
|
+
255,
|
|
528
|
+
258,
|
|
529
|
+
261,
|
|
530
|
+
264,
|
|
531
|
+
267,
|
|
532
|
+
271,
|
|
533
|
+
274,
|
|
534
|
+
277,
|
|
535
|
+
280,
|
|
536
|
+
284,
|
|
537
|
+
287,
|
|
538
|
+
291,
|
|
539
|
+
294,
|
|
540
|
+
298,
|
|
541
|
+
301,
|
|
542
|
+
305,
|
|
543
|
+
309,
|
|
544
|
+
312,
|
|
545
|
+
316,
|
|
546
|
+
320,
|
|
547
|
+
324,
|
|
548
|
+
328,
|
|
549
|
+
332,
|
|
550
|
+
336,
|
|
551
|
+
340,
|
|
552
|
+
344,
|
|
553
|
+
348,
|
|
554
|
+
352,
|
|
555
|
+
357,
|
|
556
|
+
361,
|
|
557
|
+
365,
|
|
558
|
+
370,
|
|
559
|
+
374,
|
|
560
|
+
379,
|
|
561
|
+
383,
|
|
562
|
+
388,
|
|
563
|
+
392,
|
|
564
|
+
397,
|
|
565
|
+
402,
|
|
566
|
+
407,
|
|
567
|
+
412,
|
|
568
|
+
417,
|
|
569
|
+
422,
|
|
570
|
+
427,
|
|
571
|
+
432,
|
|
572
|
+
437,
|
|
573
|
+
442,
|
|
574
|
+
448,
|
|
575
|
+
453,
|
|
576
|
+
459,
|
|
577
|
+
464,
|
|
578
|
+
470,
|
|
579
|
+
475,
|
|
580
|
+
481,
|
|
581
|
+
487,
|
|
582
|
+
493,
|
|
583
|
+
499,
|
|
584
|
+
505,
|
|
585
|
+
511,
|
|
586
|
+
517,
|
|
587
|
+
523,
|
|
588
|
+
530,
|
|
589
|
+
536,
|
|
590
|
+
542,
|
|
591
|
+
549,
|
|
592
|
+
556,
|
|
593
|
+
562,
|
|
594
|
+
569,
|
|
595
|
+
576,
|
|
596
|
+
583,
|
|
597
|
+
590,
|
|
598
|
+
597,
|
|
599
|
+
604,
|
|
600
|
+
612,
|
|
601
|
+
619,
|
|
602
|
+
626,
|
|
603
|
+
634,
|
|
604
|
+
642,
|
|
605
|
+
649,
|
|
606
|
+
657,
|
|
607
|
+
665,
|
|
608
|
+
673,
|
|
609
|
+
681,
|
|
610
|
+
690,
|
|
611
|
+
698,
|
|
612
|
+
706,
|
|
613
|
+
715,
|
|
614
|
+
723,
|
|
615
|
+
732,
|
|
616
|
+
741,
|
|
617
|
+
750,
|
|
618
|
+
759,
|
|
619
|
+
768,
|
|
620
|
+
777,
|
|
621
|
+
787,
|
|
622
|
+
796,
|
|
623
|
+
806,
|
|
624
|
+
816,
|
|
625
|
+
825,
|
|
626
|
+
835,
|
|
627
|
+
845,
|
|
628
|
+
856,
|
|
629
|
+
866,
|
|
630
|
+
876,
|
|
631
|
+
887,
|
|
632
|
+
898,
|
|
633
|
+
909,
|
|
634
|
+
920,
|
|
635
|
+
931,
|
|
636
|
+
942,
|
|
637
|
+
953,
|
|
638
|
+
965,
|
|
639
|
+
976,
|
|
640
|
+
988
|
|
641
|
+
]
|
|
642
|
+
});
|
|
643
|
+
const roundUp = (n, granularity) => {
|
|
644
|
+
if (n == 0) return 0;
|
|
645
|
+
const series = PREFERRED_NUMBERS[granularity];
|
|
646
|
+
const first = series[0];
|
|
647
|
+
const last = series[series.length - 1];
|
|
648
|
+
let multiplier = 1;
|
|
649
|
+
while (n >= last * multiplier) {
|
|
650
|
+
multiplier *= 10;
|
|
651
|
+
}
|
|
652
|
+
let previousMin = 0;
|
|
653
|
+
while (n < first * multiplier) {
|
|
654
|
+
previousMin = first * multiplier;
|
|
655
|
+
multiplier /= 10;
|
|
656
|
+
if (n >= last * multiplier) {
|
|
657
|
+
return previousMin;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
(0, import_util.assert)(
|
|
661
|
+
n >= first * multiplier && n < last * multiplier,
|
|
662
|
+
"$bucketAuto: number out of range of series."
|
|
663
|
+
);
|
|
664
|
+
const i = (0, import_util.findInsertIndex)(series, n, (a, b) => {
|
|
665
|
+
b *= multiplier;
|
|
666
|
+
if (a < b) return -1;
|
|
667
|
+
if (a > b) return 1;
|
|
668
|
+
return 0;
|
|
97
669
|
});
|
|
670
|
+
const seriesNumber = series[i] * multiplier;
|
|
671
|
+
return n == seriesNumber ? series[i + 1] * multiplier : seriesNumber;
|
|
98
672
|
};
|
|
673
|
+
function granularityPreferredSeries(sorted, bucketCount, granularity) {
|
|
674
|
+
const size = sorted.length;
|
|
675
|
+
const approxBucketSize = Math.max(1, Math.round(sorted.length / bucketCount));
|
|
676
|
+
let index = 0;
|
|
677
|
+
let nBuckets = 0;
|
|
678
|
+
let min = 0;
|
|
679
|
+
let max = 0;
|
|
680
|
+
return () => {
|
|
681
|
+
const isLastBucket = ++nBuckets == bucketCount;
|
|
682
|
+
const bucket = new Array();
|
|
683
|
+
min = index > 0 ? max : 0;
|
|
684
|
+
while (index < size && (isLastBucket || bucket.length < approxBucketSize)) {
|
|
685
|
+
bucket.push(sorted[index++][1]);
|
|
686
|
+
}
|
|
687
|
+
max = roundUp(sorted[index - 1][0], granularity);
|
|
688
|
+
const nItems = bucket.length;
|
|
689
|
+
while (index < size && (isLastBucket || sorted[index][0] < max)) {
|
|
690
|
+
bucket.push(sorted[index++][1]);
|
|
691
|
+
}
|
|
692
|
+
if (nItems != bucket.length) {
|
|
693
|
+
max = roundUp(sorted[index - 1][0], granularity);
|
|
694
|
+
}
|
|
695
|
+
(0, import_util.assert)(min < max, `$bucketAuto: ${min} < ${max}.`);
|
|
696
|
+
return {
|
|
697
|
+
min,
|
|
698
|
+
max,
|
|
699
|
+
bucket,
|
|
700
|
+
done: index >= size
|
|
701
|
+
};
|
|
702
|
+
};
|
|
703
|
+
}
|
|
99
704
|
// Annotate the CommonJS export names for ESM import in node:
|
|
100
705
|
0 && (module.exports = {
|
|
101
706
|
$bucketAuto
|