Socket
Socket
Sign inDemoInstall

@alipay/faas-db-builder

Package Overview
Dependencies
Maintainers
3
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alipay/faas-db-builder - npm Package Compare versions

Comparing version 1.1.16-alpha.5 to 1.1.16-alpha.6

esm/command/aggregate.d.ts

6

esm/command/AbstractCommand.d.ts

@@ -11,7 +11,7 @@ export declare abstract class AbstractCommand {

}
export declare abstract class AggregateCommand<T = any> extends AbstractCommand {
export declare abstract class AggregateCommand extends AbstractCommand {
protected readonly name: string;
protected readonly value: T;
protected constructor(name: string, value: T);
protected readonly value: any;
protected constructor(name: string, value: any);
stringify(): any;
}

@@ -1,62 +0,10 @@

import { CondCommandParam, DateToStringCommandParam, IndexOfArrayCommandParam, LetCommandParam, MapParam, PushCommandParam, QueryChainCommand, SliceCommandParam, SwitchCommandParam } from '../typing';
import { AbsAggregateCommand } from './aggregate/abs';
import { AddAggregateCommand } from './aggregate/add';
import { AddToSetAggregateCommand } from './aggregate/addToSet';
import { AndAggregateCommand } from './aggregate/and';
import { ArrayElemAtAggregateCommand } from './aggregate/arrayElemAt';
import { AvgAggregateCommand } from './aggregate/avg';
import { CeilAggregateCommand } from './aggregate/ceil';
import { CMPAggregateCommand } from './aggregate/cmp';
import { ConcatAggregateCommand } from './aggregate/concat';
import { CondAggregateCommand } from './aggregate/cond';
import { CountAggregateCommand } from './aggregate/count';
import { DateToStringAggregateCommand } from './aggregate/dateToString';
import { DivideAggregateCommand } from './aggregate/divide';
import { EqAggregateCommand } from './aggregate/eq';
import { ExpAggregateCommand } from './aggregate/exp';
import { FirstAggregateCommand } from './aggregate/first';
import { FloorAggregateCommand } from './aggregate/floor';
import { IfNullAggregateCommand } from './aggregate/ifNull';
import { InAggregateCommand } from './aggregate/in';
import { IndexOfArrayAggregateCommand } from './aggregate/indexOfArray';
import { IsArrayAggregateCommand } from './aggregate/isArray';
import { ISOWeekAggregateCommand } from './aggregate/isoWeek';
import { LastAggregateCommand } from './aggregate/last';
import { LetAggregateCommand } from './aggregate/let';
import { LnAggregateCommand } from './aggregate/ln';
import { LogAggregateCommand } from './aggregate/log';
import { Log10AggregateCommand } from './aggregate/log10';
import { MapAggregateCommand } from './aggregate/map';
import { MergeObjectsAggregateCommand } from './aggregate/mergeObjects';
import { ModAggregateCommand } from './aggregate/mod';
import { MonthAggregateCommand } from './aggregate/month';
import { MultiplyAggregateCommand } from './aggregate/multiply';
import { NotAggregateCommand } from './aggregate/not';
import { PowAggregateCommand } from './aggregate/pow';
import { PushAggregateCommand } from './aggregate/push';
import { SizeAggregateCommand } from './aggregate/size';
import { SliceAggregateCommand } from './aggregate/slice';
import { SplitAggregateCommand } from './aggregate/split';
import { SqrtAggregateCommand } from './aggregate/sqrt';
import { SubstrAggregateCommand } from './aggregate/substr';
import { SubstrBytesAggregateCommand } from './aggregate/substrBytes';
import { SubtractAggregateCommand } from './aggregate/subtract';
import { SwitchAggregateCommand } from './aggregate/switch';
import { ToLowerAggregateCommand } from './aggregate/toLower';
import { ToUpperAggregateCommand } from './aggregate/toUpper';
import { TruncAggregateCommand } from './aggregate/trunc';
import { WeekAggregateCommand } from './aggregate/week';
import { YearAggregateCommand } from './aggregate/year';
import { Sort } from '../common/constant';
import { AggregateArrayExpression, AggregateDateExpression, AggregateDateParam, AggregateDocumentExpression, AggregateExpression, AggregateExpressionPair, AggregateExpressionRecord, AggregateNumberExpression, AggregateNumberExpressionPair, AggregateStringExpression, AggregateStringExpressionPair, CondCommandParam, DateToStringCommandParam, IndexOfArrayCommandParam, LetCommandParam, MapParam, PushCommandParam, QueryChainCommand, SliceCommandParam, SubstrBytesCommandParam, SubstrCommandParam, SubtractCommandParam, SwitchCommandParam } from '../typing';
import { AggregateCommand, QueryCommand } from './AbstractCommand';
import { AbsAggregateCommand, AddAggregateCommand, AddToSetAggregateCommand, AndAggregateCommand, ArrayElemAtAggregateCommand, AvgAggregateCommand, CeilAggregateCommand, CMPAggregateCommand, ConcatAggregateCommand, CondAggregateCommand, CountAggregateCommand, DateToStringAggregateCommand, DivideAggregateCommand, EqAggregateCommand, ExpAggregateCommand, FirstAggregateCommand, FloorAggregateCommand, GtAggregateCommand, GteAggregateCommand, IfNullAggregateCommand, InAggregateCommand, IndexOfArrayAggregateCommand, IsArrayAggregateCommand, ISOWeekAggregateCommand, LastAggregateCommand, LetAggregateCommand, LnAggregateCommand, Log10AggregateCommand, LogAggregateCommand, LtAggregateCommand, LteAggregateCommand, MapAggregateCommand, MaxAggregateCommand, MergeObjectsAggregateCommand, MinAggregateCommand, ModAggregateCommand, MonthAggregateCommand, MultiplyAggregateCommand, NeqAggregateCommand, NotAggregateCommand, OrAggregateCommand, PowAggregateCommand, PushAggregateCommand, SizeAggregateCommand, SliceAggregateCommand, SplitAggregateCommand, SqrtAggregateCommand, SubstrAggregateCommand, SubstrBytesAggregateCommand, SubtractAggregateCommand, SumAggregateCommand, SwitchAggregateCommand, ToLowerAggregateCommand, ToUpperAggregateCommand, TruncAggregateCommand, WeekAggregateCommand, YearAggregateCommand } from './aggregate';
import { AggregatePipeline } from './AggregatePipeline';
import { ExprCommand } from './query/expr';
import { GtAggregateCommand } from './aggregate/gt';
import { GteAggregateCommand } from './aggregate/gte';
import { LtAggregateCommand } from './aggregate/lt';
import { LteAggregateCommand } from './aggregate/lte';
import { MaxAggregateCommand } from './aggregate/max';
import { MinAggregateCommand } from './aggregate/min';
import { NeqAggregateCommand } from './aggregate/neq';
import { OrAggregateCommand } from './aggregate/or';
import { SumAggregateCommand } from './aggregate/sum';
import { QueryChain } from './query/QueryChain';
import { AddToSetCommand } from './update/addToSet';
import { IncCommand } from './update/inc';
import { MaxCommand } from './update/max';

@@ -72,93 +20,89 @@ import { MinCommand } from './update/min';

import { SetCommand } from './update/set';
import { IncCommand } from './update/inc';
import { AggregateCommand, QueryCommand } from './AbstractCommand';
import { QueryChain } from './query/QueryChain';
import { Sort } from '../common/constant';
export declare class AggregateCommandFactory {
pipeline(): AggregatePipeline;
avg(val: string | AggregateCommand): AvgAggregateCommand;
avg(val: AggregateExpression | AggregateExpression[]): AvgAggregateCommand;
count(): CountAggregateCommand;
max(val: string | AggregateCommand): MaxAggregateCommand;
min(val: string | AggregateCommand): MinAggregateCommand;
sum(val: string | number | AggregateCommand | any[]): SumAggregateCommand;
and(cmd: Array<object | AggregateCommand>): AndAggregateCommand;
and(...cmd: Array<object | AggregateCommand>): AndAggregateCommand;
or(cmd: Array<object | AggregateCommand>): OrAggregateCommand;
or(...cmd: Array<object | AggregateCommand>): OrAggregateCommand;
not(cmd: object | AggregateCommand): NotAggregateCommand;
cmp(values: [any, any]): CMPAggregateCommand;
cmp(values: any, other: any): CMPAggregateCommand;
eq(values: [any, any]): EqAggregateCommand;
eq(values: any, other: any): EqAggregateCommand;
neq(values: [any, any]): NeqAggregateCommand;
neq(values: any, other: any): NeqAggregateCommand;
lt(values: [any, any]): LtAggregateCommand;
lt(values: any, other: any): LtAggregateCommand;
lte(values: [any, any]): LteAggregateCommand;
lte(values: any, other: any): LteAggregateCommand;
gt(values: [any, any]): GtAggregateCommand;
gt(values: any, other: any): GtAggregateCommand;
gte(values: [any, any]): GteAggregateCommand;
gte(values: any, other: any): GteAggregateCommand;
addToSet(value: string): AddToSetAggregateCommand;
arrayElemAt(array: [string, number]): ArrayElemAtAggregateCommand;
arrayElemAt(array: string, idx: number): ArrayElemAtAggregateCommand;
max(val: AggregateExpression | AggregateExpression[]): MaxAggregateCommand;
min(val: AggregateExpression | AggregateExpression[]): MinAggregateCommand;
sum(val: AggregateExpression | AggregateExpression[]): SumAggregateCommand;
and(cmd: Array<AggregateExpression>): AndAggregateCommand;
and(...cmd: Array<AggregateExpression>): AndAggregateCommand;
or(cmd: Array<AggregateExpression>): OrAggregateCommand;
or(...cmd: Array<AggregateExpression>): OrAggregateCommand;
not(cmd: AggregateExpression): NotAggregateCommand;
cmp(values: AggregateExpressionPair): CMPAggregateCommand;
cmp(values: AggregateExpression, other: AggregateExpression): CMPAggregateCommand;
eq(values: AggregateExpressionPair): EqAggregateCommand;
eq(values: AggregateExpression, other: AggregateExpression): EqAggregateCommand;
neq(values: AggregateExpressionPair): NeqAggregateCommand;
neq(values: AggregateExpression, other: AggregateExpression): NeqAggregateCommand;
lt(values: AggregateExpressionPair): LtAggregateCommand;
lt(values: AggregateExpression, other: AggregateExpression): LtAggregateCommand;
lte(values: AggregateExpressionPair): LteAggregateCommand;
lte(values: AggregateExpression, other: AggregateExpression): LteAggregateCommand;
gt(values: AggregateExpressionPair): GtAggregateCommand;
gt(values: AggregateExpression, other: AggregateExpression): GtAggregateCommand;
gte(values: AggregateExpressionPair): GteAggregateCommand;
gte(values: AggregateExpression, other: AggregateExpression): GteAggregateCommand;
addToSet(value: AggregateExpression): AddToSetAggregateCommand;
arrayElemAt(array: [AggregateArrayExpression, AggregateNumberExpression]): ArrayElemAtAggregateCommand;
arrayElemAt(array: AggregateArrayExpression, idx: AggregateNumberExpression): ArrayElemAtAggregateCommand;
indexOfArray(array: IndexOfArrayCommandParam): IndexOfArrayAggregateCommand;
indexOfArray(array: string, value: any): IndexOfArrayAggregateCommand;
indexOfArray(array: string, value: any, start: number): IndexOfArrayAggregateCommand;
indexOfArray(array: string, value: any, start: number, end: number): IndexOfArrayAggregateCommand;
isArray(value: string): IsArrayAggregateCommand;
size(value: string): SizeAggregateCommand;
in(target: any, key: string): InAggregateCommand;
in(target: [any, string]): InAggregateCommand;
indexOfArray(array: AggregateArrayExpression, value: AggregateExpression): IndexOfArrayAggregateCommand;
indexOfArray(array: AggregateArrayExpression, value: AggregateExpression, start: number): IndexOfArrayAggregateCommand;
indexOfArray(array: AggregateArrayExpression, value: AggregateExpression, start: number, end: number): IndexOfArrayAggregateCommand;
isArray(value: AggregateExpression): IsArrayAggregateCommand;
size(value: AggregateArrayExpression): SizeAggregateCommand;
in(target: AggregateExpression, key: AggregateArrayExpression): InAggregateCommand;
in(target: [AggregateExpression, AggregateArrayExpression]): InAggregateCommand;
slice(cond: SliceCommandParam): SliceAggregateCommand;
slice(cond: string, n: number): SliceAggregateCommand;
slice(cond: string, position: number, n: number): SliceAggregateCommand;
slice(cond: AggregateArrayExpression, n: AggregateNumberExpression): SliceAggregateCommand;
slice(cond: AggregateArrayExpression, position: AggregateNumberExpression, n: AggregateNumberExpression): SliceAggregateCommand;
map(param: MapParam): MapAggregateCommand;
ifNull(value: [string, any]): IfNullAggregateCommand;
ifNull(value: string, replacement: any): IfNullAggregateCommand;
ifNull(value: AggregateExpressionPair): IfNullAggregateCommand;
ifNull(value: AggregateExpression, replacement: AggregateExpression): IfNullAggregateCommand;
cond(value: CondCommandParam): CondAggregateCommand;
switch(value: SwitchCommandParam): SwitchAggregateCommand;
concat(...str: string[]): ConcatAggregateCommand;
concat(str: string[]): ConcatAggregateCommand;
concat(...str: AggregateStringExpression[]): ConcatAggregateCommand;
concat(str: AggregateStringExpression[]): ConcatAggregateCommand;
dateToString(value: DateToStringCommandParam): DateToStringAggregateCommand;
toLower(value: string): ToLowerAggregateCommand;
toUpper(value: string): ToUpperAggregateCommand;
split(value: [string, string]): SplitAggregateCommand;
split(value: string, splitter: string): SplitAggregateCommand;
substr(value: [string, number, number]): SubstrAggregateCommand;
substr(value: string, start: number, length: number): SubstrAggregateCommand;
substrBytes(value: [string, number, number]): SubstrBytesAggregateCommand;
substrBytes(value: string, start: number, length: number): SubstrBytesAggregateCommand;
first(value: string): FirstAggregateCommand;
last(value: string): LastAggregateCommand;
push(value: string | Record<string, string>): PushAggregateCommand;
toLower(value: AggregateStringExpression): ToLowerAggregateCommand;
toUpper(value: AggregateStringExpression): ToUpperAggregateCommand;
split(value: AggregateStringExpressionPair): SplitAggregateCommand;
split(value: AggregateStringExpression, splitter: AggregateStringExpression): SplitAggregateCommand;
substr(value: SubstrCommandParam): SubstrAggregateCommand;
substr(value: AggregateStringExpression, start: AggregateNumberExpression, length: AggregateNumberExpression): SubstrAggregateCommand;
substrBytes(value: SubstrBytesCommandParam): SubstrBytesAggregateCommand;
substrBytes(value: AggregateStringExpression, start: AggregateNumberExpression, length: AggregateNumberExpression): SubstrBytesAggregateCommand;
first(value: AggregateExpression): FirstAggregateCommand;
last(value: AggregateExpression): LastAggregateCommand;
push(value: AggregateExpression | AggregateExpressionRecord): PushAggregateCommand;
let(value: LetCommandParam): LetAggregateCommand;
add(val: any[]): AddAggregateCommand;
add(...val: any[]): AddAggregateCommand;
subtract(val: any[]): SubtractAggregateCommand;
subtract(...val: any[]): SubtractAggregateCommand;
multiply(val: any[]): MultiplyAggregateCommand;
multiply(...val: any[]): MultiplyAggregateCommand;
divide(val: any[]): DivideAggregateCommand;
divide(...val: any[]): DivideAggregateCommand;
abs(value: string | AggregateCommand): AbsAggregateCommand;
ceil(value: string | AggregateCommand): CeilAggregateCommand;
exp(value: string | AggregateCommand): ExpAggregateCommand;
floor(value: string | AggregateCommand): FloorAggregateCommand;
ln(value: string | AggregateCommand): LnAggregateCommand;
log(val: any[]): LogAggregateCommand;
log(...val: any[]): LogAggregateCommand;
log10(value: string | AggregateCommand): Log10AggregateCommand;
mod(val: any[]): ModAggregateCommand;
mod(...val: any[]): ModAggregateCommand;
pow(val: any[]): PowAggregateCommand;
pow(...val: any[]): PowAggregateCommand;
sqrt(val: string | AggregateCommand): SqrtAggregateCommand;
trunc(value: string | AggregateCommand): TruncAggregateCommand;
mergeObjects(value: string | AggregateCommand | Array<string | AggregateCommand>): MergeObjectsAggregateCommand;
month(value: string): MonthAggregateCommand;
year(value: string): YearAggregateCommand;
week(value: string): WeekAggregateCommand;
isoWeek(value: string): ISOWeekAggregateCommand;
add(val: AggregateNumberExpression[]): AddAggregateCommand;
add(...val: AggregateNumberExpression[]): AddAggregateCommand;
subtract(num1: SubtractCommandParam): SubtractAggregateCommand;
subtract(num1: AggregateDateExpression, num2: AggregateNumberExpression): SubtractAggregateCommand;
multiply(val: AggregateNumberExpression[]): MultiplyAggregateCommand;
multiply(...val: AggregateNumberExpression[]): MultiplyAggregateCommand;
divide(val: AggregateNumberExpressionPair): DivideAggregateCommand;
divide(num1: AggregateNumberExpression, num2: AggregateNumberExpression): DivideAggregateCommand;
abs(value: AggregateNumberExpression): AbsAggregateCommand;
ceil(value: AggregateNumberExpression): CeilAggregateCommand;
exp(value: AggregateNumberExpression): ExpAggregateCommand;
floor(value: AggregateNumberExpression): FloorAggregateCommand;
ln(value: AggregateNumberExpression): LnAggregateCommand;
log(val: AggregateNumberExpressionPair): LogAggregateCommand;
log(num1: AggregateNumberExpression, num2: AggregateNumberExpression): LogAggregateCommand;
log10(value: AggregateNumberExpression): Log10AggregateCommand;
mod(val: AggregateNumberExpressionPair): ModAggregateCommand;
mod(num1: AggregateNumberExpression, num2: AggregateNumberExpression): ModAggregateCommand;
pow(val: AggregateNumberExpressionPair): PowAggregateCommand;
pow(num1: AggregateNumberExpression, num2: AggregateNumberExpression): PowAggregateCommand;
sqrt(val: AggregateNumberExpression): SqrtAggregateCommand;
trunc(value: AggregateNumberExpression | AggregateNumberExpressionPair): TruncAggregateCommand;
mergeObjects(value: AggregateDocumentExpression | AggregateDocumentExpression[]): MergeObjectsAggregateCommand;
month(value: AggregateDateParam): MonthAggregateCommand;
year(value: AggregateDateParam): YearAggregateCommand;
week(value: AggregateDateParam): WeekAggregateCommand;
isoWeek(value: AggregateDateParam): ISOWeekAggregateCommand;
}

@@ -165,0 +109,0 @@ export declare class Command {

@@ -1,1 +0,1 @@

var u=function(o,r,t){if(t||arguments.length===2)for(var n=0,m=r.length,a;n<m;n++){if(a||!(n in r)){if(!a)a=Array.prototype.slice.call(r,0,n);a[n]=r[n]}}return o.concat(a||Array.prototype.slice.call(r))};import{AbsAggregateCommand as y}from"./aggregate/abs";import{AddAggregateCommand as A}from"./aggregate/add";import{AddToSetAggregateCommand as d}from"./aggregate/addToSet";import{AndAggregateCommand as c}from"./aggregate/and";import{ArrayElemAtAggregateCommand as w}from"./aggregate/arrayElemAt";import{AvgAggregateCommand as C}from"./aggregate/avg";import{CeilAggregateCommand as s}from"./aggregate/ceil";import{CMPAggregateCommand as l}from"./aggregate/cmp";import{ConcatAggregateCommand as v}from"./aggregate/concat";import{CondAggregateCommand as h}from"./aggregate/cond";import{CountAggregateCommand as S}from"./aggregate/count";import{DateToStringAggregateCommand as x}from"./aggregate/dateToString";import{DivideAggregateCommand as M}from"./aggregate/divide";import{EqAggregateCommand as b}from"./aggregate/eq";import{ExpAggregateCommand as L}from"./aggregate/exp";import{FirstAggregateCommand as q}from"./aggregate/first";import{FloorAggregateCommand as T}from"./aggregate/floor";import{IfNullAggregateCommand as E}from"./aggregate/ifNull";import{InAggregateCommand as N}from"./aggregate/in";import{IndexOfArrayAggregateCommand as P}from"./aggregate/indexOfArray";import{IsArrayAggregateCommand as I}from"./aggregate/isArray";import{ISOWeekAggregateCommand as O}from"./aggregate/isoWeek";import{LastAggregateCommand as k}from"./aggregate/last";import{LetAggregateCommand as z}from"./aggregate/let";import{LnAggregateCommand as F}from"./aggregate/ln";import{LogAggregateCommand as G}from"./aggregate/log";import{Log10AggregateCommand as U}from"./aggregate/log10";import{MapAggregateCommand as W}from"./aggregate/map";import{MergeObjectsAggregateCommand as j}from"./aggregate/mergeObjects";import{ModAggregateCommand as B}from"./aggregate/mod";import{MonthAggregateCommand as D}from"./aggregate/month";import{MultiplyAggregateCommand as R}from"./aggregate/multiply";import{NotAggregateCommand as Q}from"./aggregate/not";import{PowAggregateCommand as Y}from"./aggregate/pow";import{PushAggregateCommand as H}from"./aggregate/push";import{SizeAggregateCommand as J}from"./aggregate/size";import{SliceAggregateCommand as K}from"./aggregate/slice";import{SplitAggregateCommand as V}from"./aggregate/split";import{SqrtAggregateCommand as X}from"./aggregate/sqrt";import{SubstrAggregateCommand as Z}from"./aggregate/substr";import{SubstrBytesAggregateCommand as $}from"./aggregate/substrBytes";import{SubtractAggregateCommand as _}from"./aggregate/subtract";import{SwitchAggregateCommand as rr}from"./aggregate/switch";import{ToLowerAggregateCommand as tr}from"./aggregate/toLower";import{ToUpperAggregateCommand as or}from"./aggregate/toUpper";import{TruncAggregateCommand as nr}from"./aggregate/trunc";import{WeekAggregateCommand as er}from"./aggregate/week";import{YearAggregateCommand as mr}from"./aggregate/year";import{AggregatePipeline as ar}from"./AggregatePipeline";import{ExprCommand as pr}from"./query/expr";import{GtAggregateCommand as ur}from"./aggregate/gt";import{GteAggregateCommand as gr}from"./aggregate/gte";import{LtAggregateCommand as ir}from"./aggregate/lt";import{LteAggregateCommand as fr}from"./aggregate/lte";import{MaxAggregateCommand as yr}from"./aggregate/max";import{MinAggregateCommand as Ar}from"./aggregate/min";import{NeqAggregateCommand as dr}from"./aggregate/neq";import{OrAggregateCommand as cr}from"./aggregate/or";import{SumAggregateCommand as wr}from"./aggregate/sum";import{AddToSetCommand as Cr}from"./update/addToSet";import{MaxCommand as sr}from"./update/max";import{MinCommand as lr}from"./update/min";import{MulCommand as vr}from"./update/mul";import{PopCommand as hr}from"./update/pop";import{PullCommand as Sr}from"./update/pull";import{PullAllCommand as xr}from"./update/pullAll";import{PushCommand as g}from"./update/push";import{RemoveCommand as Mr}from"./update/remove";import{RenameCommand as br}from"./update/rename";import{SetCommand as Lr}from"./update/set";import{IncCommand as qr}from"./update/inc";import{QueryChain as e}from"./query/QueryChain";import{OrCommand as Tr}from"./query/or";import{AndCommand as Er}from"./query/and";import{CommandUtils as p}from"./util";import{NotCommand as Nr}from"./query/not";import{NorCommand as Pr}from"./query/nor";import{EqCommand as Ir}from"./query/eq";import{NeqCommand as Or}from"./query/neq";import{LtCommand as kr}from"./query/lt";import{LteCommand as zr}from"./query/lte";import{GtCommand as Fr}from"./query/gt";import{GteCommand as Gr}from"./query/gte";import{InCommand as Ur}from"./query/in";import{NinCommand as Wr}from"./query/nin";import{ExistsCommand as jr}from"./query/exists";import{ModCommand as Br}from"./query/mod";import{AllCommand as Dr}from"./query/all";import{ElemMatchCommand as Rr}from"./query/elemMatch";import{SizeCommand as Qr}from"./query/size";import{Sort as Yr}from"../common/constant";var i=function(){function o(){}o.prototype.pipeline=function(){return new ar};o.prototype.avg=function(r){return new C(r)};o.prototype.count=function(){return new S};o.prototype.max=function(r){return new yr(r)};o.prototype.min=function(r){return new Ar(r)};o.prototype.sum=function(r){return new wr(r)};o.prototype.and=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}r=Array.isArray(r[0])?r[0]:r;return new c(r)};o.prototype.or=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}r=Array.isArray(r[0])?r[0]:r;return new cr(r)};o.prototype.not=function(r){return new Q(r)};o.prototype.cmp=function(r,t){var n=Array.isArray(r)?r:[r,t];return new l(n)};o.prototype.eq=function(r,t){var n=Array.isArray(r)?r:[r,t];return new b(n)};o.prototype.neq=function(r,t){var n=Array.isArray(r)?r:[r,t];return new dr(n)};o.prototype.lt=function(r,t){var n=Array.isArray(r)?r:[r,t];return new ir(n)};o.prototype.lte=function(r,t){var n=Array.isArray(r)?r:[r,t];return new fr(n)};o.prototype.gt=function(r,t){var n=Array.isArray(r)?r:[r,t];return new ur(n)};o.prototype.gte=function(r,t){var n=Array.isArray(r)?r:[r,t];return new gr(n)};o.prototype.addToSet=function(r){return new d(r)};o.prototype.arrayElemAt=function(r,t){var n=Array.isArray(r)?r:[r,t];return new w(n)};o.prototype.indexOfArray=function(r,t,n,m){var a=Array.isArray(r)?r:[r,t,n,m].filter(function(f){return f!==void 0});return new P(a)};o.prototype.isArray=function(r){return new I(r)};o.prototype.size=function(r){return new J(r)};o.prototype.in=function(r,t){var n=Array.isArray(r)?r:[r,t];return new N(n)};o.prototype.slice=function(r,t,n){var m=Array.isArray(r)?r:[r,t,n].filter(function(a){return a!==void 0});return new K(m)};o.prototype.map=function(r){return new W(r)};o.prototype.ifNull=function(r,t){var n=Array.isArray(r)?r:[r,t];return new E(n)};o.prototype.cond=function(r){return new h(r)};o.prototype.switch=function(r){return new rr(r)};o.prototype.concat=function(r){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}var m=Array.isArray(r)?r:u([r],t,true);return new v(m)};o.prototype.dateToString=function(r){return new x(r)};o.prototype.toLower=function(r){return new tr(r)};o.prototype.toUpper=function(r){return new or(r)};o.prototype.split=function(r,t){var n=Array.isArray(r)?r:[r,t];return new V(n)};o.prototype.substr=function(r,t,n){var m=Array.isArray(r)?r:[r,t,n];return new Z(m)};o.prototype.substrBytes=function(r,t,n){var m=Array.isArray(r)?r:[r,t,n];return new $(m)};o.prototype.first=function(r){return new q(r)};o.prototype.last=function(r){return new k(r)};o.prototype.push=function(r){return new H(r)};o.prototype.let=function(r){return new z(r)};o.prototype.add=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}var n=Array.isArray(r[0])?r[0]:r;return new A(n)};o.prototype.subtract=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}var n=Array.isArray(r[0])?r[0]:r;return new _(n)};o.prototype.multiply=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}var n=Array.isArray(r[0])?r[0]:r;return new R(n)};o.prototype.divide=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}var n=Array.isArray(r[0])?r[0]:r;return new M(n)};o.prototype.abs=function(r){return new y(r)};o.prototype.ceil=function(r){return new s(r)};o.prototype.exp=function(r){return new L(r)};o.prototype.floor=function(r){return new T(r)};o.prototype.ln=function(r){return new F(r)};o.prototype.log=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}var n=Array.isArray(r[0])?r[0]:r;return new G(n)};o.prototype.log10=function(r){return new U(r)};o.prototype.mod=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}var n=Array.isArray(r[0])?r[0]:r;return new B(n)};o.prototype.pow=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}var n=Array.isArray(r[0])?r[0]:r;return new Y(n)};o.prototype.sqrt=function(r){return new X(r)};o.prototype.trunc=function(r){return new nr(r)};o.prototype.mergeObjects=function(r){return new j(r)};o.prototype.month=function(r){return new D(r)};o.prototype.year=function(r){return new mr(r)};o.prototype.week=function(r){return new er(r)};o.prototype.isoWeek=function(r){return new O(r)};return o}();export{i as AggregateCommandFactory};var Hr=function(){function o(){this.aggregate=new i;this.Sort=Yr}o.prototype.addToSet=function(r){return new Cr(r)};o.prototype.inc=function(r){return new qr(r)};o.prototype.max=function(r){return new sr(r)};o.prototype.min=function(r){return new lr(r)};o.prototype.mul=function(r){return new vr(r)};o.prototype.pop=function(r){return new hr(r)};o.prototype.pull=function(r){return new Sr(r)};o.prototype.pullAll=function(r){return new xr(r)};o.prototype.push=function(r){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}return new(g.bind.apply(g,u([void 0,r],t,false)))};o.prototype.remove=function(){return new Mr};o.prototype.rename=function(r){return new br(r)};o.prototype.set=function(r){return new Lr(r)};o.prototype.expr=function(r){return new pr(r)};o.prototype.and=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}r=Array.isArray(r[0])?r[0]:r;var n=new Er(r.map(p.unchain));return new e(n)};o.prototype.or=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}r=Array.isArray(r[0])?r[0]:r;var n=new Tr(r.map(p.unchain));return new e(n)};o.prototype.not=function(r){var t=new Nr(p.unchain(r));return new e(t)};o.prototype.nor=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}r=Array.isArray(r[0])?r[0]:r;var n=new Pr(r.map(p.unchain));return new e(n)};o.prototype.eq=function(r){return new e(new Ir(r))};o.prototype.neq=function(r){return new e(new Or(r))};o.prototype.lt=function(r){return new e(new kr(r))};o.prototype.lte=function(r){return new e(new zr(r))};o.prototype.gt=function(r){return new e(new Fr(r))};o.prototype.gte=function(r){return new e(new Gr(r))};o.prototype.in=function(r){return new e(new Ur(r))};o.prototype.nin=function(r){return new e(new Wr(r))};o.prototype.exists=function(r){return new e(new jr(r))};o.prototype.mod=function(r,t){return new e(new Br(r,t))};o.prototype.all=function(r){return new e(new Dr(r))};o.prototype.elemMatch=function(r){return new e(new Rr(p.unchain(r)))};o.prototype.size=function(r){return new e(new Qr(r))};return o}();export{Hr as Command};
var p=function(t,r,e){if(e||arguments.length===2)for(var n=0,o=r.length,m;n<o;n++){if(m||!(n in r)){if(!m)m=Array.prototype.slice.call(r,0,n);m[n]=r[n]}}return t.concat(m||Array.prototype.slice.call(r))};import{Sort as f}from"../common/constant";import{AbsAggregateCommand as A,AddAggregateCommand as d,AddToSetAggregateCommand as c,AndAggregateCommand as w,ArrayElemAtAggregateCommand as C,AvgAggregateCommand as s,CeilAggregateCommand as l,CMPAggregateCommand as v,ConcatAggregateCommand as h,CondAggregateCommand as S,CountAggregateCommand as x,DateToStringAggregateCommand as M,DivideAggregateCommand as b,EqAggregateCommand as L,ExpAggregateCommand as q,FirstAggregateCommand as T,FloorAggregateCommand as E,GtAggregateCommand as N,GteAggregateCommand as P,IfNullAggregateCommand as I,InAggregateCommand as O,IndexOfArrayAggregateCommand as k,IsArrayAggregateCommand as z,ISOWeekAggregateCommand as F,LastAggregateCommand as G,LetAggregateCommand as U,LnAggregateCommand as W,Log10AggregateCommand as j,LogAggregateCommand as B,LtAggregateCommand as D,LteAggregateCommand as R,MapAggregateCommand as Q,MaxAggregateCommand as Y,MergeObjectsAggregateCommand as H,MinAggregateCommand as J,ModAggregateCommand as K,MonthAggregateCommand as V,MultiplyAggregateCommand as X,NeqAggregateCommand as Z,NotAggregateCommand as $,OrAggregateCommand as _,PowAggregateCommand as rr,PushAggregateCommand as tr,SizeAggregateCommand as nr,SliceAggregateCommand as er,SplitAggregateCommand as or,SqrtAggregateCommand as ar,SubstrAggregateCommand as mr,SubstrBytesAggregateCommand as pr,SubtractAggregateCommand as ur,SumAggregateCommand as gr,SwitchAggregateCommand as ir,ToLowerAggregateCommand as yr,ToUpperAggregateCommand as fr,TruncAggregateCommand as Ar,WeekAggregateCommand as dr,YearAggregateCommand as cr}from"./aggregate";import{AggregatePipeline as wr}from"./AggregatePipeline";import{AllCommand as Cr}from"./query/all";import{AndCommand as sr}from"./query/and";import{ElemMatchCommand as lr}from"./query/elemMatch";import{EqCommand as vr}from"./query/eq";import{ExistsCommand as hr}from"./query/exists";import{ExprCommand as Sr}from"./query/expr";import{GtCommand as xr}from"./query/gt";import{GteCommand as Mr}from"./query/gte";import{InCommand as br}from"./query/in";import{LtCommand as Lr}from"./query/lt";import{LteCommand as qr}from"./query/lte";import{ModCommand as Tr}from"./query/mod";import{NeqCommand as Er}from"./query/neq";import{NinCommand as Nr}from"./query/nin";import{NorCommand as Pr}from"./query/nor";import{NotCommand as Ir}from"./query/not";import{OrCommand as Or}from"./query/or";import{QueryChain as a}from"./query/QueryChain";import{SizeCommand as kr}from"./query/size";import{AddToSetCommand as zr}from"./update/addToSet";import{IncCommand as Fr}from"./update/inc";import{MaxCommand as Gr}from"./update/max";import{MinCommand as Ur}from"./update/min";import{MulCommand as Wr}from"./update/mul";import{PopCommand as jr}from"./update/pop";import{PullCommand as Br}from"./update/pull";import{PullAllCommand as Dr}from"./update/pullAll";import{PushCommand as g}from"./update/push";import{RemoveCommand as Rr}from"./update/remove";import{RenameCommand as Qr}from"./update/rename";import{SetCommand as Yr}from"./update/set";import{CommandUtils as u}from"./util";var i=function(){function t(){}t.prototype.pipeline=function(){return new wr};t.prototype.avg=function(r){return new s(r)};t.prototype.count=function(){return new x};t.prototype.max=function(r){return new Y(r)};t.prototype.min=function(r){return new J(r)};t.prototype.sum=function(r){return new gr(r)};t.prototype.and=function(r){var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}var o=Array.isArray(r)?r:p([r],e,true);return new w(o)};t.prototype.or=function(r){var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}var o=Array.isArray(r)?r:p([r],e,true);return new _(o)};t.prototype.not=function(r){return new $(r)};t.prototype.cmp=function(r,e){var n=Array.isArray(r)?r:[r,e];return new v(n)};t.prototype.eq=function(r,e){var n=Array.isArray(r)?r:[r,e];return new L(n)};t.prototype.neq=function(r,e){var n=Array.isArray(r)?r:[r,e];return new Z(n)};t.prototype.lt=function(r,e){var n=Array.isArray(r)?r:[r,e];return new D(n)};t.prototype.lte=function(r,e){var n=Array.isArray(r)?r:[r,e];return new R(n)};t.prototype.gt=function(r,e){var n=Array.isArray(r)?r:[r,e];return new N(n)};t.prototype.gte=function(r,e){var n=Array.isArray(r)?r:[r,e];return new P(n)};t.prototype.addToSet=function(r){return new c(r)};t.prototype.arrayElemAt=function(r,e){var n=Array.isArray(r)?r:[r,e];return new C(n)};t.prototype.indexOfArray=function(r,e,n,o){var m=Array.isArray(r)?r:[r,e,n,o].filter(function(y){return y!==void 0});return new k(m)};t.prototype.isArray=function(r){return new z(r)};t.prototype.size=function(r){return new nr(r)};t.prototype.in=function(r,e){var n=Array.isArray(r)?r:[r,e];return new O(n)};t.prototype.slice=function(r,e,n){var o=Array.isArray(r)?r:[r,e,n].filter(function(m){return m!==void 0});return new er(o)};t.prototype.map=function(r){return new Q(r)};t.prototype.ifNull=function(r,e){var n=Array.isArray(r)?r:[r,e];return new I(n)};t.prototype.cond=function(r){return new S(r)};t.prototype.switch=function(r){return new ir(r)};t.prototype.concat=function(r){var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}var o=Array.isArray(r)?r:p([r],e,true);return new h(o)};t.prototype.dateToString=function(r){return new M(r)};t.prototype.toLower=function(r){return new yr(r)};t.prototype.toUpper=function(r){return new fr(r)};t.prototype.split=function(r,e){var n=Array.isArray(r)?r:[r,e];return new or(n)};t.prototype.substr=function(r,e,n){var o=Array.isArray(r)?r:[r,e,n];return new mr(o)};t.prototype.substrBytes=function(r,e,n){var o=Array.isArray(r)?r:[r,e,n];return new pr(o)};t.prototype.first=function(r){return new T(r)};t.prototype.last=function(r){return new G(r)};t.prototype.push=function(r){return new tr(r)};t.prototype.let=function(r){return new U(r)};t.prototype.add=function(r){var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}var o=Array.isArray(r)?r:p([r],e,true);return new d(o)};t.prototype.subtract=function(r,e){var n=Array.isArray(r)?r:[r,e];return new ur(n)};t.prototype.multiply=function(r){var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}var o=Array.isArray(r)?r:p([r],e,true);return new X(o)};t.prototype.divide=function(r,e){var n=Array.isArray(r)?r:[r,e];return new b(n)};t.prototype.abs=function(r){return new A(r)};t.prototype.ceil=function(r){return new l(r)};t.prototype.exp=function(r){return new q(r)};t.prototype.floor=function(r){return new E(r)};t.prototype.ln=function(r){return new W(r)};t.prototype.log=function(r,e){var n=Array.isArray(r)?r:[r,e];return new B(n)};t.prototype.log10=function(r){return new j(r)};t.prototype.mod=function(r,e){var n=Array.isArray(r)?r:[r,e];return new K(n)};t.prototype.pow=function(r,e){var n=Array.isArray(r)?r:[r,e];return new rr(n)};t.prototype.sqrt=function(r){return new ar(r)};t.prototype.trunc=function(r){return new Ar(r)};t.prototype.mergeObjects=function(r){return new H(r)};t.prototype.month=function(r){return new V(r)};t.prototype.year=function(r){return new cr(r)};t.prototype.week=function(r){return new dr(r)};t.prototype.isoWeek=function(r){return new F(r)};return t}();export{i as AggregateCommandFactory};var Hr=function(){function t(){this.aggregate=new i;this.Sort=f}t.prototype.addToSet=function(r){return new zr(r)};t.prototype.inc=function(r){return new Fr(r)};t.prototype.max=function(r){return new Gr(r)};t.prototype.min=function(r){return new Ur(r)};t.prototype.mul=function(r){return new Wr(r)};t.prototype.pop=function(r){return new jr(r)};t.prototype.pull=function(r){return new Br(r)};t.prototype.pullAll=function(r){return new Dr(r)};t.prototype.push=function(r){var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}return new(g.bind.apply(g,p([void 0,r],e,false)))};t.prototype.remove=function(){return new Rr};t.prototype.rename=function(r){return new Qr(r)};t.prototype.set=function(r){return new Yr(r)};t.prototype.expr=function(r){return new Sr(r)};t.prototype.and=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}r=Array.isArray(r[0])?r[0]:r;var n=new sr(r.map(u.unchain));return new a(n)};t.prototype.or=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}r=Array.isArray(r[0])?r[0]:r;var n=new Or(r.map(u.unchain));return new a(n)};t.prototype.not=function(r){var e=new Ir(u.unchain(r));return new a(e)};t.prototype.nor=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}r=Array.isArray(r[0])?r[0]:r;var n=new Pr(r.map(u.unchain));return new a(n)};t.prototype.eq=function(r){return new a(new vr(r))};t.prototype.neq=function(r){return new a(new Er(r))};t.prototype.lt=function(r){return new a(new Lr(r))};t.prototype.lte=function(r){return new a(new qr(r))};t.prototype.gt=function(r){return new a(new xr(r))};t.prototype.gte=function(r){return new a(new Mr(r))};t.prototype.in=function(r){return new a(new br(r))};t.prototype.nin=function(r){return new a(new Nr(r))};t.prototype.exists=function(r){return new a(new hr(r))};t.prototype.mod=function(r,e){return new a(new Tr(r,e))};t.prototype.all=function(r){return new a(new Cr(r))};t.prototype.elemMatch=function(r){return new a(new lr(u.unchain(r)))};t.prototype.size=function(r){return new a(new kr(r))};return t}();export{Hr as Command};

@@ -1,1 +0,1 @@

var c=function(){var r=function(n,t){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))o[i]=e[i]};return r(n,t)};return function(n,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(n,t);function o(){this.constructor=n}n.prototype=t===null?Object.create(t):(o.prototype=t.prototype,new o)}}();import{QueryCommand as s}from"../AbstractCommand";import{CommandUtils as a}from"../util";var f=function(r){c(n,r);function n(t){var o=r.call(this)||this;o.command=a.stringify(t);return o}n.prototype.stringify=function(){return{$not:this.command.stringify()}};return n}(s);export{f as NotCommand};
var c=function(){var r=function(o,t){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))n[i]=e[i]};return r(o,t)};return function(o,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(o,t);function n(){this.constructor=o}o.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();import{QueryCommand as a}from"../AbstractCommand";import{CommandUtils as s}from"../util";var u=function(r){c(o,r);function o(t){var n=r.call(this)||this;n.command=s.stringify(t);return n}o.prototype.stringify=function(){return{$not:this.command}};return o}(a);export{u as NotCommand};

@@ -1,9 +0,3 @@

import { EJSON } from 'bson';
import { MongoCollectionListQueryOperation, MongoCollectionOperation, MongoDocumentOperation } from '../typing';
import { CollectionAction, DocumentAction } from './constant';
export declare class MongoSerializer {
static serialize(data: any): import("bson").Document;
static deserialize(data: any): EJSON.SerializableTypes;
static filterUndefinedKey(o: any, visited: any[]): any;
}
export declare class ActionBuilder {

@@ -10,0 +4,0 @@ static buildCollectionAction(action: CollectionAction, collectionName: string): MongoCollectionOperation;

@@ -1,1 +0,1 @@

import{EJSON as c}from"bson";import{CollectionAction as l,Target as r}from"./constant";var o=function(){function i(){}i.serialize=function(e){i.filterUndefinedKey(e,[e]);return c.serialize(e)};i.deserialize=function(e){return c.deserialize(e)};i.filterUndefinedKey=function(e,n){if(n.includes(e)){return}n.push(e);if(!e||typeof e!=="object"){return e}for(var t in e){if(e[t]===void 0){delete e[t]}else{i.filterUndefinedKey(e[t],n)}}};return i}();export{o as MongoSerializer};var u=function(){function i(){}i.buildCollectionAction=function(e,n){return{target:r.collection,action:e,collectionName:n}};i.buildCollectionListQueryAction=function(e){return{target:r.collection,action:l.queryList,options:o.serialize(e)}};i.buildDocumentAction=function(e,n,t){return{target:r.document,action:e,collectionName:n,options:o.serialize(t)}};return i}();export{u as ActionBuilder};
import{CollectionAction as e,Target as i}from"./constant";var r=function(){function o(){}o.buildCollectionAction=function(t,n){return{target:i.collection,action:t,collectionName:n}};o.buildCollectionListQueryAction=function(t){return{target:i.collection,action:e.queryList,options:t}};o.buildDocumentAction=function(t,n,c){return{target:i.document,action:t,collectionName:n,options:c}};return o}();export{r as ActionBuilder};

@@ -14,4 +14,3 @@ export * from './typing';

export { CommandUtils } from './command/util';
export { MongoSerializer } from './common/util';
export { DbBuildError, ErrorCode } from './common/error';
export * from './common/constant';

@@ -1,1 +0,1 @@

export*from"./typing";export{MongoBuilder}from"./mongo-builder";export{CollectionBuilder}from"./mongo-builder/Collection";export{DocumentBuilder}from"./mongo-builder/Document";export{QueryBuilder}from"./mongo-builder/Query";export{RegExp}from"./mongo-builder/RegExp";export{AggregateBuilder}from"./mongo-builder/Aggregate";export{QueryRequest}from"./command/QueryRequest";export{UpdateRequest}from"./command/UpdateRequest";export{AggregateRequest}from"./command/AggregateRequest";export{Command,AggregateCommandFactory}from"./command";export{AggregateCommand,QueryCommand,UpdateCommand,UpdateArrayCommand}from"./command/AbstractCommand";export{CommandUtils}from"./command/util";export{MongoSerializer}from"./common/util";export{DbBuildError,ErrorCode}from"./common/error";export*from"./common/constant";
export*from"./typing";export{MongoBuilder}from"./mongo-builder";export{CollectionBuilder}from"./mongo-builder/Collection";export{DocumentBuilder}from"./mongo-builder/Document";export{QueryBuilder}from"./mongo-builder/Query";export{RegExp}from"./mongo-builder/RegExp";export{AggregateBuilder}from"./mongo-builder/Aggregate";export{QueryRequest}from"./command/QueryRequest";export{UpdateRequest}from"./command/UpdateRequest";export{AggregateRequest}from"./command/AggregateRequest";export{Command,AggregateCommandFactory}from"./command";export{AggregateCommand,QueryCommand,UpdateCommand,UpdateArrayCommand}from"./command/AbstractCommand";export{CommandUtils}from"./command/util";export{DbBuildError,ErrorCode}from"./common/error";export*from"./common/constant";

@@ -6,2 +6,13 @@ import { AggregateCommand, QueryCommand } from './command/AbstractCommand';

export type UnchainCommand<T> = T extends QueryChain ? never : T;
export type AggregateExpression<T = any> = string | AggregateCommand | T;
export type AggregateExpressionPair = [AggregateExpression, AggregateExpression];
export type AggregateArrayExpression = AggregateExpression<any[]>;
export type AggregateNumberExpression = AggregateExpression<number>;
export type AggregateNumberExpressionPair = [AggregateNumberExpression, AggregateNumberExpression];
export type AggregateStringExpression = string | AggregateCommand;
export type AggregateStringExpressionPair = [AggregateStringExpression, AggregateStringExpression];
export type AggregateBooleanExpression = AggregateExpression<boolean>;
export type AggregateDateExpression = AggregateExpression<Date | number>;
export type AggregateDocumentExpression = AggregateExpression<object>;
export type AggregateExpressionRecord = Record<string, AggregateExpression>;
export interface SortOption {

@@ -78,5 +89,5 @@ field: string;

}
export type IndexOfArrayCommandParam = [string, any, number?, number?];
export type IndexOfArrayCommandParam = [AggregateArrayExpression, AggregateExpression, number?, number?];
export interface DateToStringCommandParam {
date: string;
date: AggregateDateExpression;
format?: string;

@@ -86,21 +97,21 @@ timezone?: string;

}
export type SliceCommandParam = [string, number, number?];
export type SliceCommandParam = [AggregateArrayExpression, AggregateNumberExpression, AggregateNumberExpression?];
export interface CondCommandObjectParam {
if: object | AggregateCommand;
if: AggregateBooleanExpression;
then: any;
else: any;
}
export type CondCommandArrayParam = [object | AggregateCommand, any, any];
export type CondCommandArrayParam = [AggregateBooleanExpression, any, any];
export type CondCommandParam = CondCommandObjectParam | CondCommandArrayParam;
export interface SwitchCommandBranch {
case: object | AggregateCommand;
then: any;
case: AggregateBooleanExpression;
then: AggregateExpression;
}
export interface SwitchCommandParam {
branches: Array<SwitchCommandBranch | [object | AggregateCommand, any]>;
default?: any;
branches: Array<SwitchCommandBranch | [AggregateBooleanExpression, AggregateExpression]>;
default?: AggregateExpression;
}
export interface LetCommandParam {
vars: Record<string, object | AggregateCommand>;
in: object | AggregateCommand;
vars: Record<string, AggregateExpression>;
in: AggregateExpression;
}

@@ -120,5 +131,13 @@ export interface ReplaceRootParam {

export interface MapParam {
input: string;
as: string;
in: AggregateCommand;
input: AggregateExpression;
as?: string;
in: AggregateExpression;
}
export interface AggregateDateWithTimezone {
date: AggregateDateExpression;
timezone?: string;
}
export type AggregateDateParam = AggregateDateExpression | AggregateDateWithTimezone;
export type SubstrCommandParam = [AggregateStringExpression, AggregateNumberExpression, AggregateNumberExpression];
export type SubstrBytesCommandParam = SubstrCommandParam;
export type SubtractCommandParam = [AggregateDateExpression, AggregateNumberExpression];

@@ -11,7 +11,7 @@ export declare abstract class AbstractCommand {

}
export declare abstract class AggregateCommand<T = any> extends AbstractCommand {
export declare abstract class AggregateCommand extends AbstractCommand {
protected readonly name: string;
protected readonly value: T;
protected constructor(name: string, value: T);
protected readonly value: any;
protected constructor(name: string, value: any);
stringify(): any;
}

@@ -1,62 +0,10 @@

import { CondCommandParam, DateToStringCommandParam, IndexOfArrayCommandParam, LetCommandParam, MapParam, PushCommandParam, QueryChainCommand, SliceCommandParam, SwitchCommandParam } from '../typing';
import { AbsAggregateCommand } from './aggregate/abs';
import { AddAggregateCommand } from './aggregate/add';
import { AddToSetAggregateCommand } from './aggregate/addToSet';
import { AndAggregateCommand } from './aggregate/and';
import { ArrayElemAtAggregateCommand } from './aggregate/arrayElemAt';
import { AvgAggregateCommand } from './aggregate/avg';
import { CeilAggregateCommand } from './aggregate/ceil';
import { CMPAggregateCommand } from './aggregate/cmp';
import { ConcatAggregateCommand } from './aggregate/concat';
import { CondAggregateCommand } from './aggregate/cond';
import { CountAggregateCommand } from './aggregate/count';
import { DateToStringAggregateCommand } from './aggregate/dateToString';
import { DivideAggregateCommand } from './aggregate/divide';
import { EqAggregateCommand } from './aggregate/eq';
import { ExpAggregateCommand } from './aggregate/exp';
import { FirstAggregateCommand } from './aggregate/first';
import { FloorAggregateCommand } from './aggregate/floor';
import { IfNullAggregateCommand } from './aggregate/ifNull';
import { InAggregateCommand } from './aggregate/in';
import { IndexOfArrayAggregateCommand } from './aggregate/indexOfArray';
import { IsArrayAggregateCommand } from './aggregate/isArray';
import { ISOWeekAggregateCommand } from './aggregate/isoWeek';
import { LastAggregateCommand } from './aggregate/last';
import { LetAggregateCommand } from './aggregate/let';
import { LnAggregateCommand } from './aggregate/ln';
import { LogAggregateCommand } from './aggregate/log';
import { Log10AggregateCommand } from './aggregate/log10';
import { MapAggregateCommand } from './aggregate/map';
import { MergeObjectsAggregateCommand } from './aggregate/mergeObjects';
import { ModAggregateCommand } from './aggregate/mod';
import { MonthAggregateCommand } from './aggregate/month';
import { MultiplyAggregateCommand } from './aggregate/multiply';
import { NotAggregateCommand } from './aggregate/not';
import { PowAggregateCommand } from './aggregate/pow';
import { PushAggregateCommand } from './aggregate/push';
import { SizeAggregateCommand } from './aggregate/size';
import { SliceAggregateCommand } from './aggregate/slice';
import { SplitAggregateCommand } from './aggregate/split';
import { SqrtAggregateCommand } from './aggregate/sqrt';
import { SubstrAggregateCommand } from './aggregate/substr';
import { SubstrBytesAggregateCommand } from './aggregate/substrBytes';
import { SubtractAggregateCommand } from './aggregate/subtract';
import { SwitchAggregateCommand } from './aggregate/switch';
import { ToLowerAggregateCommand } from './aggregate/toLower';
import { ToUpperAggregateCommand } from './aggregate/toUpper';
import { TruncAggregateCommand } from './aggregate/trunc';
import { WeekAggregateCommand } from './aggregate/week';
import { YearAggregateCommand } from './aggregate/year';
import { Sort } from '../common/constant';
import { AggregateArrayExpression, AggregateDateExpression, AggregateDateParam, AggregateDocumentExpression, AggregateExpression, AggregateExpressionPair, AggregateExpressionRecord, AggregateNumberExpression, AggregateNumberExpressionPair, AggregateStringExpression, AggregateStringExpressionPair, CondCommandParam, DateToStringCommandParam, IndexOfArrayCommandParam, LetCommandParam, MapParam, PushCommandParam, QueryChainCommand, SliceCommandParam, SubstrBytesCommandParam, SubstrCommandParam, SubtractCommandParam, SwitchCommandParam } from '../typing';
import { AggregateCommand, QueryCommand } from './AbstractCommand';
import { AbsAggregateCommand, AddAggregateCommand, AddToSetAggregateCommand, AndAggregateCommand, ArrayElemAtAggregateCommand, AvgAggregateCommand, CeilAggregateCommand, CMPAggregateCommand, ConcatAggregateCommand, CondAggregateCommand, CountAggregateCommand, DateToStringAggregateCommand, DivideAggregateCommand, EqAggregateCommand, ExpAggregateCommand, FirstAggregateCommand, FloorAggregateCommand, GtAggregateCommand, GteAggregateCommand, IfNullAggregateCommand, InAggregateCommand, IndexOfArrayAggregateCommand, IsArrayAggregateCommand, ISOWeekAggregateCommand, LastAggregateCommand, LetAggregateCommand, LnAggregateCommand, Log10AggregateCommand, LogAggregateCommand, LtAggregateCommand, LteAggregateCommand, MapAggregateCommand, MaxAggregateCommand, MergeObjectsAggregateCommand, MinAggregateCommand, ModAggregateCommand, MonthAggregateCommand, MultiplyAggregateCommand, NeqAggregateCommand, NotAggregateCommand, OrAggregateCommand, PowAggregateCommand, PushAggregateCommand, SizeAggregateCommand, SliceAggregateCommand, SplitAggregateCommand, SqrtAggregateCommand, SubstrAggregateCommand, SubstrBytesAggregateCommand, SubtractAggregateCommand, SumAggregateCommand, SwitchAggregateCommand, ToLowerAggregateCommand, ToUpperAggregateCommand, TruncAggregateCommand, WeekAggregateCommand, YearAggregateCommand } from './aggregate';
import { AggregatePipeline } from './AggregatePipeline';
import { ExprCommand } from './query/expr';
import { GtAggregateCommand } from './aggregate/gt';
import { GteAggregateCommand } from './aggregate/gte';
import { LtAggregateCommand } from './aggregate/lt';
import { LteAggregateCommand } from './aggregate/lte';
import { MaxAggregateCommand } from './aggregate/max';
import { MinAggregateCommand } from './aggregate/min';
import { NeqAggregateCommand } from './aggregate/neq';
import { OrAggregateCommand } from './aggregate/or';
import { SumAggregateCommand } from './aggregate/sum';
import { QueryChain } from './query/QueryChain';
import { AddToSetCommand } from './update/addToSet';
import { IncCommand } from './update/inc';
import { MaxCommand } from './update/max';

@@ -72,93 +20,89 @@ import { MinCommand } from './update/min';

import { SetCommand } from './update/set';
import { IncCommand } from './update/inc';
import { AggregateCommand, QueryCommand } from './AbstractCommand';
import { QueryChain } from './query/QueryChain';
import { Sort } from '../common/constant';
export declare class AggregateCommandFactory {
pipeline(): AggregatePipeline;
avg(val: string | AggregateCommand): AvgAggregateCommand;
avg(val: AggregateExpression | AggregateExpression[]): AvgAggregateCommand;
count(): CountAggregateCommand;
max(val: string | AggregateCommand): MaxAggregateCommand;
min(val: string | AggregateCommand): MinAggregateCommand;
sum(val: string | number | AggregateCommand | any[]): SumAggregateCommand;
and(cmd: Array<object | AggregateCommand>): AndAggregateCommand;
and(...cmd: Array<object | AggregateCommand>): AndAggregateCommand;
or(cmd: Array<object | AggregateCommand>): OrAggregateCommand;
or(...cmd: Array<object | AggregateCommand>): OrAggregateCommand;
not(cmd: object | AggregateCommand): NotAggregateCommand;
cmp(values: [any, any]): CMPAggregateCommand;
cmp(values: any, other: any): CMPAggregateCommand;
eq(values: [any, any]): EqAggregateCommand;
eq(values: any, other: any): EqAggregateCommand;
neq(values: [any, any]): NeqAggregateCommand;
neq(values: any, other: any): NeqAggregateCommand;
lt(values: [any, any]): LtAggregateCommand;
lt(values: any, other: any): LtAggregateCommand;
lte(values: [any, any]): LteAggregateCommand;
lte(values: any, other: any): LteAggregateCommand;
gt(values: [any, any]): GtAggregateCommand;
gt(values: any, other: any): GtAggregateCommand;
gte(values: [any, any]): GteAggregateCommand;
gte(values: any, other: any): GteAggregateCommand;
addToSet(value: string): AddToSetAggregateCommand;
arrayElemAt(array: [string, number]): ArrayElemAtAggregateCommand;
arrayElemAt(array: string, idx: number): ArrayElemAtAggregateCommand;
max(val: AggregateExpression | AggregateExpression[]): MaxAggregateCommand;
min(val: AggregateExpression | AggregateExpression[]): MinAggregateCommand;
sum(val: AggregateExpression | AggregateExpression[]): SumAggregateCommand;
and(cmd: Array<AggregateExpression>): AndAggregateCommand;
and(...cmd: Array<AggregateExpression>): AndAggregateCommand;
or(cmd: Array<AggregateExpression>): OrAggregateCommand;
or(...cmd: Array<AggregateExpression>): OrAggregateCommand;
not(cmd: AggregateExpression): NotAggregateCommand;
cmp(values: AggregateExpressionPair): CMPAggregateCommand;
cmp(values: AggregateExpression, other: AggregateExpression): CMPAggregateCommand;
eq(values: AggregateExpressionPair): EqAggregateCommand;
eq(values: AggregateExpression, other: AggregateExpression): EqAggregateCommand;
neq(values: AggregateExpressionPair): NeqAggregateCommand;
neq(values: AggregateExpression, other: AggregateExpression): NeqAggregateCommand;
lt(values: AggregateExpressionPair): LtAggregateCommand;
lt(values: AggregateExpression, other: AggregateExpression): LtAggregateCommand;
lte(values: AggregateExpressionPair): LteAggregateCommand;
lte(values: AggregateExpression, other: AggregateExpression): LteAggregateCommand;
gt(values: AggregateExpressionPair): GtAggregateCommand;
gt(values: AggregateExpression, other: AggregateExpression): GtAggregateCommand;
gte(values: AggregateExpressionPair): GteAggregateCommand;
gte(values: AggregateExpression, other: AggregateExpression): GteAggregateCommand;
addToSet(value: AggregateExpression): AddToSetAggregateCommand;
arrayElemAt(array: [AggregateArrayExpression, AggregateNumberExpression]): ArrayElemAtAggregateCommand;
arrayElemAt(array: AggregateArrayExpression, idx: AggregateNumberExpression): ArrayElemAtAggregateCommand;
indexOfArray(array: IndexOfArrayCommandParam): IndexOfArrayAggregateCommand;
indexOfArray(array: string, value: any): IndexOfArrayAggregateCommand;
indexOfArray(array: string, value: any, start: number): IndexOfArrayAggregateCommand;
indexOfArray(array: string, value: any, start: number, end: number): IndexOfArrayAggregateCommand;
isArray(value: string): IsArrayAggregateCommand;
size(value: string): SizeAggregateCommand;
in(target: any, key: string): InAggregateCommand;
in(target: [any, string]): InAggregateCommand;
indexOfArray(array: AggregateArrayExpression, value: AggregateExpression): IndexOfArrayAggregateCommand;
indexOfArray(array: AggregateArrayExpression, value: AggregateExpression, start: number): IndexOfArrayAggregateCommand;
indexOfArray(array: AggregateArrayExpression, value: AggregateExpression, start: number, end: number): IndexOfArrayAggregateCommand;
isArray(value: AggregateExpression): IsArrayAggregateCommand;
size(value: AggregateArrayExpression): SizeAggregateCommand;
in(target: AggregateExpression, key: AggregateArrayExpression): InAggregateCommand;
in(target: [AggregateExpression, AggregateArrayExpression]): InAggregateCommand;
slice(cond: SliceCommandParam): SliceAggregateCommand;
slice(cond: string, n: number): SliceAggregateCommand;
slice(cond: string, position: number, n: number): SliceAggregateCommand;
slice(cond: AggregateArrayExpression, n: AggregateNumberExpression): SliceAggregateCommand;
slice(cond: AggregateArrayExpression, position: AggregateNumberExpression, n: AggregateNumberExpression): SliceAggregateCommand;
map(param: MapParam): MapAggregateCommand;
ifNull(value: [string, any]): IfNullAggregateCommand;
ifNull(value: string, replacement: any): IfNullAggregateCommand;
ifNull(value: AggregateExpressionPair): IfNullAggregateCommand;
ifNull(value: AggregateExpression, replacement: AggregateExpression): IfNullAggregateCommand;
cond(value: CondCommandParam): CondAggregateCommand;
switch(value: SwitchCommandParam): SwitchAggregateCommand;
concat(...str: string[]): ConcatAggregateCommand;
concat(str: string[]): ConcatAggregateCommand;
concat(...str: AggregateStringExpression[]): ConcatAggregateCommand;
concat(str: AggregateStringExpression[]): ConcatAggregateCommand;
dateToString(value: DateToStringCommandParam): DateToStringAggregateCommand;
toLower(value: string): ToLowerAggregateCommand;
toUpper(value: string): ToUpperAggregateCommand;
split(value: [string, string]): SplitAggregateCommand;
split(value: string, splitter: string): SplitAggregateCommand;
substr(value: [string, number, number]): SubstrAggregateCommand;
substr(value: string, start: number, length: number): SubstrAggregateCommand;
substrBytes(value: [string, number, number]): SubstrBytesAggregateCommand;
substrBytes(value: string, start: number, length: number): SubstrBytesAggregateCommand;
first(value: string): FirstAggregateCommand;
last(value: string): LastAggregateCommand;
push(value: string | Record<string, string>): PushAggregateCommand;
toLower(value: AggregateStringExpression): ToLowerAggregateCommand;
toUpper(value: AggregateStringExpression): ToUpperAggregateCommand;
split(value: AggregateStringExpressionPair): SplitAggregateCommand;
split(value: AggregateStringExpression, splitter: AggregateStringExpression): SplitAggregateCommand;
substr(value: SubstrCommandParam): SubstrAggregateCommand;
substr(value: AggregateStringExpression, start: AggregateNumberExpression, length: AggregateNumberExpression): SubstrAggregateCommand;
substrBytes(value: SubstrBytesCommandParam): SubstrBytesAggregateCommand;
substrBytes(value: AggregateStringExpression, start: AggregateNumberExpression, length: AggregateNumberExpression): SubstrBytesAggregateCommand;
first(value: AggregateExpression): FirstAggregateCommand;
last(value: AggregateExpression): LastAggregateCommand;
push(value: AggregateExpression | AggregateExpressionRecord): PushAggregateCommand;
let(value: LetCommandParam): LetAggregateCommand;
add(val: any[]): AddAggregateCommand;
add(...val: any[]): AddAggregateCommand;
subtract(val: any[]): SubtractAggregateCommand;
subtract(...val: any[]): SubtractAggregateCommand;
multiply(val: any[]): MultiplyAggregateCommand;
multiply(...val: any[]): MultiplyAggregateCommand;
divide(val: any[]): DivideAggregateCommand;
divide(...val: any[]): DivideAggregateCommand;
abs(value: string | AggregateCommand): AbsAggregateCommand;
ceil(value: string | AggregateCommand): CeilAggregateCommand;
exp(value: string | AggregateCommand): ExpAggregateCommand;
floor(value: string | AggregateCommand): FloorAggregateCommand;
ln(value: string | AggregateCommand): LnAggregateCommand;
log(val: any[]): LogAggregateCommand;
log(...val: any[]): LogAggregateCommand;
log10(value: string | AggregateCommand): Log10AggregateCommand;
mod(val: any[]): ModAggregateCommand;
mod(...val: any[]): ModAggregateCommand;
pow(val: any[]): PowAggregateCommand;
pow(...val: any[]): PowAggregateCommand;
sqrt(val: string | AggregateCommand): SqrtAggregateCommand;
trunc(value: string | AggregateCommand): TruncAggregateCommand;
mergeObjects(value: string | AggregateCommand | Array<string | AggregateCommand>): MergeObjectsAggregateCommand;
month(value: string): MonthAggregateCommand;
year(value: string): YearAggregateCommand;
week(value: string): WeekAggregateCommand;
isoWeek(value: string): ISOWeekAggregateCommand;
add(val: AggregateNumberExpression[]): AddAggregateCommand;
add(...val: AggregateNumberExpression[]): AddAggregateCommand;
subtract(num1: SubtractCommandParam): SubtractAggregateCommand;
subtract(num1: AggregateDateExpression, num2: AggregateNumberExpression): SubtractAggregateCommand;
multiply(val: AggregateNumberExpression[]): MultiplyAggregateCommand;
multiply(...val: AggregateNumberExpression[]): MultiplyAggregateCommand;
divide(val: AggregateNumberExpressionPair): DivideAggregateCommand;
divide(num1: AggregateNumberExpression, num2: AggregateNumberExpression): DivideAggregateCommand;
abs(value: AggregateNumberExpression): AbsAggregateCommand;
ceil(value: AggregateNumberExpression): CeilAggregateCommand;
exp(value: AggregateNumberExpression): ExpAggregateCommand;
floor(value: AggregateNumberExpression): FloorAggregateCommand;
ln(value: AggregateNumberExpression): LnAggregateCommand;
log(val: AggregateNumberExpressionPair): LogAggregateCommand;
log(num1: AggregateNumberExpression, num2: AggregateNumberExpression): LogAggregateCommand;
log10(value: AggregateNumberExpression): Log10AggregateCommand;
mod(val: AggregateNumberExpressionPair): ModAggregateCommand;
mod(num1: AggregateNumberExpression, num2: AggregateNumberExpression): ModAggregateCommand;
pow(val: AggregateNumberExpressionPair): PowAggregateCommand;
pow(num1: AggregateNumberExpression, num2: AggregateNumberExpression): PowAggregateCommand;
sqrt(val: AggregateNumberExpression): SqrtAggregateCommand;
trunc(value: AggregateNumberExpression | AggregateNumberExpressionPair): TruncAggregateCommand;
mergeObjects(value: AggregateDocumentExpression | AggregateDocumentExpression[]): MergeObjectsAggregateCommand;
month(value: AggregateDateParam): MonthAggregateCommand;
year(value: AggregateDateParam): YearAggregateCommand;
week(value: AggregateDateParam): WeekAggregateCommand;
isoWeek(value: AggregateDateParam): ISOWeekAggregateCommand;
}

@@ -165,0 +109,0 @@ export declare class Command {

@@ -1,1 +0,1 @@

"use strict";var __spreadArray=this&&this.__spreadArray||function(t,r,e){if(e||arguments.length===2)for(var n=0,a=r.length,o;n<a;n++){if(o||!(n in r)){if(!o)o=Array.prototype.slice.call(r,0,n);o[n]=r[n]}}return t.concat(o||Array.prototype.slice.call(r))};Object.defineProperty(exports,"__esModule",{value:true});exports.Command=exports.AggregateCommandFactory=void 0;var abs_1=require("./aggregate/abs");var add_1=require("./aggregate/add");var addToSet_1=require("./aggregate/addToSet");var and_1=require("./aggregate/and");var arrayElemAt_1=require("./aggregate/arrayElemAt");var avg_1=require("./aggregate/avg");var ceil_1=require("./aggregate/ceil");var cmp_1=require("./aggregate/cmp");var concat_1=require("./aggregate/concat");var cond_1=require("./aggregate/cond");var count_1=require("./aggregate/count");var dateToString_1=require("./aggregate/dateToString");var divide_1=require("./aggregate/divide");var eq_1=require("./aggregate/eq");var exp_1=require("./aggregate/exp");var first_1=require("./aggregate/first");var floor_1=require("./aggregate/floor");var ifNull_1=require("./aggregate/ifNull");var in_1=require("./aggregate/in");var indexOfArray_1=require("./aggregate/indexOfArray");var isArray_1=require("./aggregate/isArray");var isoWeek_1=require("./aggregate/isoWeek");var last_1=require("./aggregate/last");var let_1=require("./aggregate/let");var ln_1=require("./aggregate/ln");var log_1=require("./aggregate/log");var log10_1=require("./aggregate/log10");var map_1=require("./aggregate/map");var mergeObjects_1=require("./aggregate/mergeObjects");var mod_1=require("./aggregate/mod");var month_1=require("./aggregate/month");var multiply_1=require("./aggregate/multiply");var not_1=require("./aggregate/not");var pow_1=require("./aggregate/pow");var push_1=require("./aggregate/push");var size_1=require("./aggregate/size");var slice_1=require("./aggregate/slice");var split_1=require("./aggregate/split");var sqrt_1=require("./aggregate/sqrt");var substr_1=require("./aggregate/substr");var substrBytes_1=require("./aggregate/substrBytes");var subtract_1=require("./aggregate/subtract");var switch_1=require("./aggregate/switch");var toLower_1=require("./aggregate/toLower");var toUpper_1=require("./aggregate/toUpper");var trunc_1=require("./aggregate/trunc");var week_1=require("./aggregate/week");var year_1=require("./aggregate/year");var AggregatePipeline_1=require("./AggregatePipeline");var expr_1=require("./query/expr");var gt_1=require("./aggregate/gt");var gte_1=require("./aggregate/gte");var lt_1=require("./aggregate/lt");var lte_1=require("./aggregate/lte");var max_1=require("./aggregate/max");var min_1=require("./aggregate/min");var neq_1=require("./aggregate/neq");var or_1=require("./aggregate/or");var sum_1=require("./aggregate/sum");var addToSet_2=require("./update/addToSet");var max_2=require("./update/max");var min_2=require("./update/min");var mul_1=require("./update/mul");var pop_1=require("./update/pop");var pull_1=require("./update/pull");var pullAll_1=require("./update/pullAll");var push_2=require("./update/push");var remove_1=require("./update/remove");var rename_1=require("./update/rename");var set_1=require("./update/set");var inc_1=require("./update/inc");var QueryChain_1=require("./query/QueryChain");var or_2=require("./query/or");var and_2=require("./query/and");var util_1=require("./util");var not_2=require("./query/not");var nor_1=require("./query/nor");var eq_2=require("./query/eq");var neq_2=require("./query/neq");var lt_2=require("./query/lt");var lte_2=require("./query/lte");var gt_2=require("./query/gt");var gte_2=require("./query/gte");var in_2=require("./query/in");var nin_1=require("./query/nin");var exists_1=require("./query/exists");var mod_2=require("./query/mod");var all_1=require("./query/all");var elemMatch_1=require("./query/elemMatch");var size_2=require("./query/size");var constant_1=require("../common/constant");var AggregateCommandFactory=function(){function t(){}t.prototype.pipeline=function(){return new AggregatePipeline_1.AggregatePipeline};t.prototype.avg=function(r){return new avg_1.AvgAggregateCommand(r)};t.prototype.count=function(){return new count_1.CountAggregateCommand};t.prototype.max=function(r){return new max_1.MaxAggregateCommand(r)};t.prototype.min=function(r){return new min_1.MinAggregateCommand(r)};t.prototype.sum=function(r){return new sum_1.SumAggregateCommand(r)};t.prototype.and=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}r=Array.isArray(r[0])?r[0]:r;return new and_1.AndAggregateCommand(r)};t.prototype.or=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}r=Array.isArray(r[0])?r[0]:r;return new or_1.OrAggregateCommand(r)};t.prototype.not=function(r){return new not_1.NotAggregateCommand(r)};t.prototype.cmp=function(r,e){var n=Array.isArray(r)?r:[r,e];return new cmp_1.CMPAggregateCommand(n)};t.prototype.eq=function(r,e){var n=Array.isArray(r)?r:[r,e];return new eq_1.EqAggregateCommand(n)};t.prototype.neq=function(r,e){var n=Array.isArray(r)?r:[r,e];return new neq_1.NeqAggregateCommand(n)};t.prototype.lt=function(r,e){var n=Array.isArray(r)?r:[r,e];return new lt_1.LtAggregateCommand(n)};t.prototype.lte=function(r,e){var n=Array.isArray(r)?r:[r,e];return new lte_1.LteAggregateCommand(n)};t.prototype.gt=function(r,e){var n=Array.isArray(r)?r:[r,e];return new gt_1.GtAggregateCommand(n)};t.prototype.gte=function(r,e){var n=Array.isArray(r)?r:[r,e];return new gte_1.GteAggregateCommand(n)};t.prototype.addToSet=function(r){return new addToSet_1.AddToSetAggregateCommand(r)};t.prototype.arrayElemAt=function(r,e){var n=Array.isArray(r)?r:[r,e];return new arrayElemAt_1.ArrayElemAtAggregateCommand(n)};t.prototype.indexOfArray=function(r,e,n,a){var o=Array.isArray(r)?r:[r,e,n,a].filter(function(g){return g!==void 0});return new indexOfArray_1.IndexOfArrayAggregateCommand(o)};t.prototype.isArray=function(r){return new isArray_1.IsArrayAggregateCommand(r)};t.prototype.size=function(r){return new size_1.SizeAggregateCommand(r)};t.prototype.in=function(r,e){var n=Array.isArray(r)?r:[r,e];return new in_1.InAggregateCommand(n)};t.prototype.slice=function(r,e,n){var a=Array.isArray(r)?r:[r,e,n].filter(function(o){return o!==void 0});return new slice_1.SliceAggregateCommand(a)};t.prototype.map=function(r){return new map_1.MapAggregateCommand(r)};t.prototype.ifNull=function(r,e){var n=Array.isArray(r)?r:[r,e];return new ifNull_1.IfNullAggregateCommand(n)};t.prototype.cond=function(r){return new cond_1.CondAggregateCommand(r)};t.prototype.switch=function(r){return new switch_1.SwitchAggregateCommand(r)};t.prototype.concat=function(r){var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}var a=Array.isArray(r)?r:__spreadArray([r],e,true);return new concat_1.ConcatAggregateCommand(a)};t.prototype.dateToString=function(r){return new dateToString_1.DateToStringAggregateCommand(r)};t.prototype.toLower=function(r){return new toLower_1.ToLowerAggregateCommand(r)};t.prototype.toUpper=function(r){return new toUpper_1.ToUpperAggregateCommand(r)};t.prototype.split=function(r,e){var n=Array.isArray(r)?r:[r,e];return new split_1.SplitAggregateCommand(n)};t.prototype.substr=function(r,e,n){var a=Array.isArray(r)?r:[r,e,n];return new substr_1.SubstrAggregateCommand(a)};t.prototype.substrBytes=function(r,e,n){var a=Array.isArray(r)?r:[r,e,n];return new substrBytes_1.SubstrBytesAggregateCommand(a)};t.prototype.first=function(r){return new first_1.FirstAggregateCommand(r)};t.prototype.last=function(r){return new last_1.LastAggregateCommand(r)};t.prototype.push=function(r){return new push_1.PushAggregateCommand(r)};t.prototype.let=function(r){return new let_1.LetAggregateCommand(r)};t.prototype.add=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}var n=Array.isArray(r[0])?r[0]:r;return new add_1.AddAggregateCommand(n)};t.prototype.subtract=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}var n=Array.isArray(r[0])?r[0]:r;return new subtract_1.SubtractAggregateCommand(n)};t.prototype.multiply=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}var n=Array.isArray(r[0])?r[0]:r;return new multiply_1.MultiplyAggregateCommand(n)};t.prototype.divide=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}var n=Array.isArray(r[0])?r[0]:r;return new divide_1.DivideAggregateCommand(n)};t.prototype.abs=function(r){return new abs_1.AbsAggregateCommand(r)};t.prototype.ceil=function(r){return new ceil_1.CeilAggregateCommand(r)};t.prototype.exp=function(r){return new exp_1.ExpAggregateCommand(r)};t.prototype.floor=function(r){return new floor_1.FloorAggregateCommand(r)};t.prototype.ln=function(r){return new ln_1.LnAggregateCommand(r)};t.prototype.log=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}var n=Array.isArray(r[0])?r[0]:r;return new log_1.LogAggregateCommand(n)};t.prototype.log10=function(r){return new log10_1.Log10AggregateCommand(r)};t.prototype.mod=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}var n=Array.isArray(r[0])?r[0]:r;return new mod_1.ModAggregateCommand(n)};t.prototype.pow=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}var n=Array.isArray(r[0])?r[0]:r;return new pow_1.PowAggregateCommand(n)};t.prototype.sqrt=function(r){return new sqrt_1.SqrtAggregateCommand(r)};t.prototype.trunc=function(r){return new trunc_1.TruncAggregateCommand(r)};t.prototype.mergeObjects=function(r){return new mergeObjects_1.MergeObjectsAggregateCommand(r)};t.prototype.month=function(r){return new month_1.MonthAggregateCommand(r)};t.prototype.year=function(r){return new year_1.YearAggregateCommand(r)};t.prototype.week=function(r){return new week_1.WeekAggregateCommand(r)};t.prototype.isoWeek=function(r){return new isoWeek_1.ISOWeekAggregateCommand(r)};return t}();exports.AggregateCommandFactory=AggregateCommandFactory;var Command=function(){function t(){this.aggregate=new AggregateCommandFactory;this.Sort=constant_1.Sort}t.prototype.addToSet=function(r){return new addToSet_2.AddToSetCommand(r)};t.prototype.inc=function(r){return new inc_1.IncCommand(r)};t.prototype.max=function(r){return new max_2.MaxCommand(r)};t.prototype.min=function(r){return new min_2.MinCommand(r)};t.prototype.mul=function(r){return new mul_1.MulCommand(r)};t.prototype.pop=function(r){return new pop_1.PopCommand(r)};t.prototype.pull=function(r){return new pull_1.PullCommand(r)};t.prototype.pullAll=function(r){return new pullAll_1.PullAllCommand(r)};t.prototype.push=function(r){var e=[];for(var n=1;n<arguments.length;n++){e[n-1]=arguments[n]}return new(push_2.PushCommand.bind.apply(push_2.PushCommand,__spreadArray([void 0,r],e,false)))};t.prototype.remove=function(){return new remove_1.RemoveCommand};t.prototype.rename=function(r){return new rename_1.RenameCommand(r)};t.prototype.set=function(r){return new set_1.SetCommand(r)};t.prototype.expr=function(r){return new expr_1.ExprCommand(r)};t.prototype.and=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}r=Array.isArray(r[0])?r[0]:r;var n=new and_2.AndCommand(r.map(util_1.CommandUtils.unchain));return new QueryChain_1.QueryChain(n)};t.prototype.or=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}r=Array.isArray(r[0])?r[0]:r;var n=new or_2.OrCommand(r.map(util_1.CommandUtils.unchain));return new QueryChain_1.QueryChain(n)};t.prototype.not=function(r){var e=new not_2.NotCommand(util_1.CommandUtils.unchain(r));return new QueryChain_1.QueryChain(e)};t.prototype.nor=function(){var r=[];for(var e=0;e<arguments.length;e++){r[e]=arguments[e]}r=Array.isArray(r[0])?r[0]:r;var n=new nor_1.NorCommand(r.map(util_1.CommandUtils.unchain));return new QueryChain_1.QueryChain(n)};t.prototype.eq=function(r){return new QueryChain_1.QueryChain(new eq_2.EqCommand(r))};t.prototype.neq=function(r){return new QueryChain_1.QueryChain(new neq_2.NeqCommand(r))};t.prototype.lt=function(r){return new QueryChain_1.QueryChain(new lt_2.LtCommand(r))};t.prototype.lte=function(r){return new QueryChain_1.QueryChain(new lte_2.LteCommand(r))};t.prototype.gt=function(r){return new QueryChain_1.QueryChain(new gt_2.GtCommand(r))};t.prototype.gte=function(r){return new QueryChain_1.QueryChain(new gte_2.GteCommand(r))};t.prototype.in=function(r){return new QueryChain_1.QueryChain(new in_2.InCommand(r))};t.prototype.nin=function(r){return new QueryChain_1.QueryChain(new nin_1.NinCommand(r))};t.prototype.exists=function(r){return new QueryChain_1.QueryChain(new exists_1.ExistsCommand(r))};t.prototype.mod=function(r,e){return new QueryChain_1.QueryChain(new mod_2.ModCommand(r,e))};t.prototype.all=function(r){return new QueryChain_1.QueryChain(new all_1.AllCommand(r))};t.prototype.elemMatch=function(r){return new QueryChain_1.QueryChain(new elemMatch_1.ElemMatchCommand(util_1.CommandUtils.unchain(r)))};t.prototype.size=function(r){return new QueryChain_1.QueryChain(new size_2.SizeCommand(r))};return t}();exports.Command=Command;
"use strict";var __spreadArray=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var n=0,o=r.length,a;n<o;n++){if(a||!(n in r)){if(!a)a=Array.prototype.slice.call(r,0,n);a[n]=r[n]}}return e.concat(a||Array.prototype.slice.call(r))};Object.defineProperty(exports,"__esModule",{value:true});exports.Command=exports.AggregateCommandFactory=void 0;var constant_1=require("../common/constant");var aggregate_1=require("./aggregate");var AggregatePipeline_1=require("./AggregatePipeline");var all_1=require("./query/all");var and_1=require("./query/and");var elemMatch_1=require("./query/elemMatch");var eq_1=require("./query/eq");var exists_1=require("./query/exists");var expr_1=require("./query/expr");var gt_1=require("./query/gt");var gte_1=require("./query/gte");var in_1=require("./query/in");var lt_1=require("./query/lt");var lte_1=require("./query/lte");var mod_1=require("./query/mod");var neq_1=require("./query/neq");var nin_1=require("./query/nin");var nor_1=require("./query/nor");var not_1=require("./query/not");var or_1=require("./query/or");var QueryChain_1=require("./query/QueryChain");var size_1=require("./query/size");var addToSet_1=require("./update/addToSet");var inc_1=require("./update/inc");var max_1=require("./update/max");var min_1=require("./update/min");var mul_1=require("./update/mul");var pop_1=require("./update/pop");var pull_1=require("./update/pull");var pullAll_1=require("./update/pullAll");var push_1=require("./update/push");var remove_1=require("./update/remove");var rename_1=require("./update/rename");var set_1=require("./update/set");var util_1=require("./util");var AggregateCommandFactory=function(){function e(){}e.prototype.pipeline=function(){return new AggregatePipeline_1.AggregatePipeline};e.prototype.avg=function(r){return new aggregate_1.AvgAggregateCommand(r)};e.prototype.count=function(){return new aggregate_1.CountAggregateCommand};e.prototype.max=function(r){return new aggregate_1.MaxAggregateCommand(r)};e.prototype.min=function(r){return new aggregate_1.MinAggregateCommand(r)};e.prototype.sum=function(r){return new aggregate_1.SumAggregateCommand(r)};e.prototype.and=function(r){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}var o=Array.isArray(r)?r:__spreadArray([r],t,true);return new aggregate_1.AndAggregateCommand(o)};e.prototype.or=function(r){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}var o=Array.isArray(r)?r:__spreadArray([r],t,true);return new aggregate_1.OrAggregateCommand(o)};e.prototype.not=function(r){return new aggregate_1.NotAggregateCommand(r)};e.prototype.cmp=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.CMPAggregateCommand(n)};e.prototype.eq=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.EqAggregateCommand(n)};e.prototype.neq=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.NeqAggregateCommand(n)};e.prototype.lt=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.LtAggregateCommand(n)};e.prototype.lte=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.LteAggregateCommand(n)};e.prototype.gt=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.GtAggregateCommand(n)};e.prototype.gte=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.GteAggregateCommand(n)};e.prototype.addToSet=function(r){return new aggregate_1.AddToSetAggregateCommand(r)};e.prototype.arrayElemAt=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.ArrayElemAtAggregateCommand(n)};e.prototype.indexOfArray=function(r,t,n,o){var a=Array.isArray(r)?r:[r,t,n,o].filter(function(u){return u!==void 0});return new aggregate_1.IndexOfArrayAggregateCommand(a)};e.prototype.isArray=function(r){return new aggregate_1.IsArrayAggregateCommand(r)};e.prototype.size=function(r){return new aggregate_1.SizeAggregateCommand(r)};e.prototype.in=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.InAggregateCommand(n)};e.prototype.slice=function(r,t,n){var o=Array.isArray(r)?r:[r,t,n].filter(function(a){return a!==void 0});return new aggregate_1.SliceAggregateCommand(o)};e.prototype.map=function(r){return new aggregate_1.MapAggregateCommand(r)};e.prototype.ifNull=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.IfNullAggregateCommand(n)};e.prototype.cond=function(r){return new aggregate_1.CondAggregateCommand(r)};e.prototype.switch=function(r){return new aggregate_1.SwitchAggregateCommand(r)};e.prototype.concat=function(r){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}var o=Array.isArray(r)?r:__spreadArray([r],t,true);return new aggregate_1.ConcatAggregateCommand(o)};e.prototype.dateToString=function(r){return new aggregate_1.DateToStringAggregateCommand(r)};e.prototype.toLower=function(r){return new aggregate_1.ToLowerAggregateCommand(r)};e.prototype.toUpper=function(r){return new aggregate_1.ToUpperAggregateCommand(r)};e.prototype.split=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.SplitAggregateCommand(n)};e.prototype.substr=function(r,t,n){var o=Array.isArray(r)?r:[r,t,n];return new aggregate_1.SubstrAggregateCommand(o)};e.prototype.substrBytes=function(r,t,n){var o=Array.isArray(r)?r:[r,t,n];return new aggregate_1.SubstrBytesAggregateCommand(o)};e.prototype.first=function(r){return new aggregate_1.FirstAggregateCommand(r)};e.prototype.last=function(r){return new aggregate_1.LastAggregateCommand(r)};e.prototype.push=function(r){return new aggregate_1.PushAggregateCommand(r)};e.prototype.let=function(r){return new aggregate_1.LetAggregateCommand(r)};e.prototype.add=function(r){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}var o=Array.isArray(r)?r:__spreadArray([r],t,true);return new aggregate_1.AddAggregateCommand(o)};e.prototype.subtract=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.SubtractAggregateCommand(n)};e.prototype.multiply=function(r){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}var o=Array.isArray(r)?r:__spreadArray([r],t,true);return new aggregate_1.MultiplyAggregateCommand(o)};e.prototype.divide=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.DivideAggregateCommand(n)};e.prototype.abs=function(r){return new aggregate_1.AbsAggregateCommand(r)};e.prototype.ceil=function(r){return new aggregate_1.CeilAggregateCommand(r)};e.prototype.exp=function(r){return new aggregate_1.ExpAggregateCommand(r)};e.prototype.floor=function(r){return new aggregate_1.FloorAggregateCommand(r)};e.prototype.ln=function(r){return new aggregate_1.LnAggregateCommand(r)};e.prototype.log=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.LogAggregateCommand(n)};e.prototype.log10=function(r){return new aggregate_1.Log10AggregateCommand(r)};e.prototype.mod=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.ModAggregateCommand(n)};e.prototype.pow=function(r,t){var n=Array.isArray(r)?r:[r,t];return new aggregate_1.PowAggregateCommand(n)};e.prototype.sqrt=function(r){return new aggregate_1.SqrtAggregateCommand(r)};e.prototype.trunc=function(r){return new aggregate_1.TruncAggregateCommand(r)};e.prototype.mergeObjects=function(r){return new aggregate_1.MergeObjectsAggregateCommand(r)};e.prototype.month=function(r){return new aggregate_1.MonthAggregateCommand(r)};e.prototype.year=function(r){return new aggregate_1.YearAggregateCommand(r)};e.prototype.week=function(r){return new aggregate_1.WeekAggregateCommand(r)};e.prototype.isoWeek=function(r){return new aggregate_1.ISOWeekAggregateCommand(r)};return e}();exports.AggregateCommandFactory=AggregateCommandFactory;var Command=function(){function e(){this.aggregate=new AggregateCommandFactory;this.Sort=constant_1.Sort}e.prototype.addToSet=function(r){return new addToSet_1.AddToSetCommand(r)};e.prototype.inc=function(r){return new inc_1.IncCommand(r)};e.prototype.max=function(r){return new max_1.MaxCommand(r)};e.prototype.min=function(r){return new min_1.MinCommand(r)};e.prototype.mul=function(r){return new mul_1.MulCommand(r)};e.prototype.pop=function(r){return new pop_1.PopCommand(r)};e.prototype.pull=function(r){return new pull_1.PullCommand(r)};e.prototype.pullAll=function(r){return new pullAll_1.PullAllCommand(r)};e.prototype.push=function(r){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}return new(push_1.PushCommand.bind.apply(push_1.PushCommand,__spreadArray([void 0,r],t,false)))};e.prototype.remove=function(){return new remove_1.RemoveCommand};e.prototype.rename=function(r){return new rename_1.RenameCommand(r)};e.prototype.set=function(r){return new set_1.SetCommand(r)};e.prototype.expr=function(r){return new expr_1.ExprCommand(r)};e.prototype.and=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}r=Array.isArray(r[0])?r[0]:r;var n=new and_1.AndCommand(r.map(util_1.CommandUtils.unchain));return new QueryChain_1.QueryChain(n)};e.prototype.or=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}r=Array.isArray(r[0])?r[0]:r;var n=new or_1.OrCommand(r.map(util_1.CommandUtils.unchain));return new QueryChain_1.QueryChain(n)};e.prototype.not=function(r){var t=new not_1.NotCommand(util_1.CommandUtils.unchain(r));return new QueryChain_1.QueryChain(t)};e.prototype.nor=function(){var r=[];for(var t=0;t<arguments.length;t++){r[t]=arguments[t]}r=Array.isArray(r[0])?r[0]:r;var n=new nor_1.NorCommand(r.map(util_1.CommandUtils.unchain));return new QueryChain_1.QueryChain(n)};e.prototype.eq=function(r){return new QueryChain_1.QueryChain(new eq_1.EqCommand(r))};e.prototype.neq=function(r){return new QueryChain_1.QueryChain(new neq_1.NeqCommand(r))};e.prototype.lt=function(r){return new QueryChain_1.QueryChain(new lt_1.LtCommand(r))};e.prototype.lte=function(r){return new QueryChain_1.QueryChain(new lte_1.LteCommand(r))};e.prototype.gt=function(r){return new QueryChain_1.QueryChain(new gt_1.GtCommand(r))};e.prototype.gte=function(r){return new QueryChain_1.QueryChain(new gte_1.GteCommand(r))};e.prototype.in=function(r){return new QueryChain_1.QueryChain(new in_1.InCommand(r))};e.prototype.nin=function(r){return new QueryChain_1.QueryChain(new nin_1.NinCommand(r))};e.prototype.exists=function(r){return new QueryChain_1.QueryChain(new exists_1.ExistsCommand(r))};e.prototype.mod=function(r,t){return new QueryChain_1.QueryChain(new mod_1.ModCommand(r,t))};e.prototype.all=function(r){return new QueryChain_1.QueryChain(new all_1.AllCommand(r))};e.prototype.elemMatch=function(r){return new QueryChain_1.QueryChain(new elemMatch_1.ElemMatchCommand(util_1.CommandUtils.unchain(r)))};e.prototype.size=function(r){return new QueryChain_1.QueryChain(new size_1.SizeCommand(r))};return e}();exports.Command=Command;

@@ -1,1 +0,1 @@

"use strict";var __extends=this&&this.__extends||function(){var r=function(o,t){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))n[i]=e[i]};return r(o,t)};return function(o,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(o,t);function n(){this.constructor=o}o.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.NotCommand=void 0;var AbstractCommand_1=require("../AbstractCommand");var util_1=require("../util");var NotCommand=function(r){__extends(o,r);function o(t){var n=r.call(this)||this;n.command=util_1.CommandUtils.stringify(t);return n}o.prototype.stringify=function(){return{$not:this.command.stringify()}};return o}(AbstractCommand_1.QueryCommand);exports.NotCommand=NotCommand;
"use strict";var __extends=this&&this.__extends||function(){var r=function(o,t){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))n[i]=e[i]};return r(o,t)};return function(o,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(o,t);function n(){this.constructor=o}o.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(exports,"__esModule",{value:true});exports.NotCommand=void 0;var AbstractCommand_1=require("../AbstractCommand");var util_1=require("../util");var NotCommand=function(r){__extends(o,r);function o(t){var n=r.call(this)||this;n.command=util_1.CommandUtils.stringify(t);return n}o.prototype.stringify=function(){return{$not:this.command}};return o}(AbstractCommand_1.QueryCommand);exports.NotCommand=NotCommand;

@@ -1,9 +0,3 @@

import { EJSON } from 'bson';
import { MongoCollectionListQueryOperation, MongoCollectionOperation, MongoDocumentOperation } from '../typing';
import { CollectionAction, DocumentAction } from './constant';
export declare class MongoSerializer {
static serialize(data: any): import("bson").Document;
static deserialize(data: any): EJSON.SerializableTypes;
static filterUndefinedKey(o: any, visited: any[]): any;
}
export declare class ActionBuilder {

@@ -10,0 +4,0 @@ static buildCollectionAction(action: CollectionAction, collectionName: string): MongoCollectionOperation;

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ActionBuilder=exports.MongoSerializer=void 0;var bson_1=require("bson");var constant_1=require("./constant");var MongoSerializer=function(){function i(){}i.serialize=function(e){i.filterUndefinedKey(e,[e]);return bson_1.EJSON.serialize(e)};i.deserialize=function(e){return bson_1.EJSON.deserialize(e)};i.filterUndefinedKey=function(e,n){if(n.includes(e)){return}n.push(e);if(!e||typeof e!=="object"){return e}for(var t in e){if(e[t]===void 0){delete e[t]}else{i.filterUndefinedKey(e[t],n)}}};return i}();exports.MongoSerializer=MongoSerializer;var ActionBuilder=function(){function i(){}i.buildCollectionAction=function(e,n){return{target:constant_1.Target.collection,action:e,collectionName:n}};i.buildCollectionListQueryAction=function(e){return{target:constant_1.Target.collection,action:constant_1.CollectionAction.queryList,options:MongoSerializer.serialize(e)}};i.buildDocumentAction=function(e,n,t){return{target:constant_1.Target.document,action:e,collectionName:n,options:MongoSerializer.serialize(t)}};return i}();exports.ActionBuilder=ActionBuilder;
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ActionBuilder=void 0;var constant_1=require("./constant");var ActionBuilder=function(){function o(){}o.buildCollectionAction=function(t,e){return{target:constant_1.Target.collection,action:t,collectionName:e}};o.buildCollectionListQueryAction=function(t){return{target:constant_1.Target.collection,action:constant_1.CollectionAction.queryList,options:t}};o.buildDocumentAction=function(t,e,n){return{target:constant_1.Target.document,action:t,collectionName:e,options:n}};return o}();exports.ActionBuilder=ActionBuilder;

@@ -14,4 +14,3 @@ export * from './typing';

export { CommandUtils } from './command/util';
export { MongoSerializer } from './common/util';
export { DbBuildError, ErrorCode } from './common/error';
export * from './common/constant';

@@ -1,1 +0,1 @@

"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(o,r,e,t){if(t===void 0)t=e;var n=Object.getOwnPropertyDescriptor(r,e);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[e]}}}Object.defineProperty(o,t,n)}:function(o,r,e,t){if(t===void 0)t=e;o[t]=r[e]});var __exportStar=this&&this.__exportStar||function(o,r){for(var e in o)if(e!=="default"&&!Object.prototype.hasOwnProperty.call(r,e))__createBinding(r,o,e)};Object.defineProperty(exports,"__esModule",{value:true});exports.ErrorCode=exports.DbBuildError=exports.MongoSerializer=exports.CommandUtils=exports.UpdateArrayCommand=exports.UpdateCommand=exports.QueryCommand=exports.AggregateCommand=exports.AggregateCommandFactory=exports.Command=exports.AggregateRequest=exports.UpdateRequest=exports.QueryRequest=exports.AggregateBuilder=exports.RegExp=exports.QueryBuilder=exports.DocumentBuilder=exports.CollectionBuilder=exports.MongoBuilder=void 0;__exportStar(require("./typing"),exports);var mongo_builder_1=require("./mongo-builder");Object.defineProperty(exports,"MongoBuilder",{enumerable:true,get:function(){return mongo_builder_1.MongoBuilder}});var Collection_1=require("./mongo-builder/Collection");Object.defineProperty(exports,"CollectionBuilder",{enumerable:true,get:function(){return Collection_1.CollectionBuilder}});var Document_1=require("./mongo-builder/Document");Object.defineProperty(exports,"DocumentBuilder",{enumerable:true,get:function(){return Document_1.DocumentBuilder}});var Query_1=require("./mongo-builder/Query");Object.defineProperty(exports,"QueryBuilder",{enumerable:true,get:function(){return Query_1.QueryBuilder}});var RegExp_1=require("./mongo-builder/RegExp");Object.defineProperty(exports,"RegExp",{enumerable:true,get:function(){return RegExp_1.RegExp}});var Aggregate_1=require("./mongo-builder/Aggregate");Object.defineProperty(exports,"AggregateBuilder",{enumerable:true,get:function(){return Aggregate_1.AggregateBuilder}});var QueryRequest_1=require("./command/QueryRequest");Object.defineProperty(exports,"QueryRequest",{enumerable:true,get:function(){return QueryRequest_1.QueryRequest}});var UpdateRequest_1=require("./command/UpdateRequest");Object.defineProperty(exports,"UpdateRequest",{enumerable:true,get:function(){return UpdateRequest_1.UpdateRequest}});var AggregateRequest_1=require("./command/AggregateRequest");Object.defineProperty(exports,"AggregateRequest",{enumerable:true,get:function(){return AggregateRequest_1.AggregateRequest}});var command_1=require("./command");Object.defineProperty(exports,"Command",{enumerable:true,get:function(){return command_1.Command}});Object.defineProperty(exports,"AggregateCommandFactory",{enumerable:true,get:function(){return command_1.AggregateCommandFactory}});var AbstractCommand_1=require("./command/AbstractCommand");Object.defineProperty(exports,"AggregateCommand",{enumerable:true,get:function(){return AbstractCommand_1.AggregateCommand}});Object.defineProperty(exports,"QueryCommand",{enumerable:true,get:function(){return AbstractCommand_1.QueryCommand}});Object.defineProperty(exports,"UpdateCommand",{enumerable:true,get:function(){return AbstractCommand_1.UpdateCommand}});Object.defineProperty(exports,"UpdateArrayCommand",{enumerable:true,get:function(){return AbstractCommand_1.UpdateArrayCommand}});var util_1=require("./command/util");Object.defineProperty(exports,"CommandUtils",{enumerable:true,get:function(){return util_1.CommandUtils}});var util_2=require("./common/util");Object.defineProperty(exports,"MongoSerializer",{enumerable:true,get:function(){return util_2.MongoSerializer}});var error_1=require("./common/error");Object.defineProperty(exports,"DbBuildError",{enumerable:true,get:function(){return error_1.DbBuildError}});Object.defineProperty(exports,"ErrorCode",{enumerable:true,get:function(){return error_1.ErrorCode}});__exportStar(require("./common/constant"),exports);
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(o,r,e,t){if(t===void 0)t=e;var n=Object.getOwnPropertyDescriptor(r,e);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[e]}}}Object.defineProperty(o,t,n)}:function(o,r,e,t){if(t===void 0)t=e;o[t]=r[e]});var __exportStar=this&&this.__exportStar||function(o,r){for(var e in o)if(e!=="default"&&!Object.prototype.hasOwnProperty.call(r,e))__createBinding(r,o,e)};Object.defineProperty(exports,"__esModule",{value:true});exports.ErrorCode=exports.DbBuildError=exports.CommandUtils=exports.UpdateArrayCommand=exports.UpdateCommand=exports.QueryCommand=exports.AggregateCommand=exports.AggregateCommandFactory=exports.Command=exports.AggregateRequest=exports.UpdateRequest=exports.QueryRequest=exports.AggregateBuilder=exports.RegExp=exports.QueryBuilder=exports.DocumentBuilder=exports.CollectionBuilder=exports.MongoBuilder=void 0;__exportStar(require("./typing"),exports);var mongo_builder_1=require("./mongo-builder");Object.defineProperty(exports,"MongoBuilder",{enumerable:true,get:function(){return mongo_builder_1.MongoBuilder}});var Collection_1=require("./mongo-builder/Collection");Object.defineProperty(exports,"CollectionBuilder",{enumerable:true,get:function(){return Collection_1.CollectionBuilder}});var Document_1=require("./mongo-builder/Document");Object.defineProperty(exports,"DocumentBuilder",{enumerable:true,get:function(){return Document_1.DocumentBuilder}});var Query_1=require("./mongo-builder/Query");Object.defineProperty(exports,"QueryBuilder",{enumerable:true,get:function(){return Query_1.QueryBuilder}});var RegExp_1=require("./mongo-builder/RegExp");Object.defineProperty(exports,"RegExp",{enumerable:true,get:function(){return RegExp_1.RegExp}});var Aggregate_1=require("./mongo-builder/Aggregate");Object.defineProperty(exports,"AggregateBuilder",{enumerable:true,get:function(){return Aggregate_1.AggregateBuilder}});var QueryRequest_1=require("./command/QueryRequest");Object.defineProperty(exports,"QueryRequest",{enumerable:true,get:function(){return QueryRequest_1.QueryRequest}});var UpdateRequest_1=require("./command/UpdateRequest");Object.defineProperty(exports,"UpdateRequest",{enumerable:true,get:function(){return UpdateRequest_1.UpdateRequest}});var AggregateRequest_1=require("./command/AggregateRequest");Object.defineProperty(exports,"AggregateRequest",{enumerable:true,get:function(){return AggregateRequest_1.AggregateRequest}});var command_1=require("./command");Object.defineProperty(exports,"Command",{enumerable:true,get:function(){return command_1.Command}});Object.defineProperty(exports,"AggregateCommandFactory",{enumerable:true,get:function(){return command_1.AggregateCommandFactory}});var AbstractCommand_1=require("./command/AbstractCommand");Object.defineProperty(exports,"AggregateCommand",{enumerable:true,get:function(){return AbstractCommand_1.AggregateCommand}});Object.defineProperty(exports,"QueryCommand",{enumerable:true,get:function(){return AbstractCommand_1.QueryCommand}});Object.defineProperty(exports,"UpdateCommand",{enumerable:true,get:function(){return AbstractCommand_1.UpdateCommand}});Object.defineProperty(exports,"UpdateArrayCommand",{enumerable:true,get:function(){return AbstractCommand_1.UpdateArrayCommand}});var util_1=require("./command/util");Object.defineProperty(exports,"CommandUtils",{enumerable:true,get:function(){return util_1.CommandUtils}});var error_1=require("./common/error");Object.defineProperty(exports,"DbBuildError",{enumerable:true,get:function(){return error_1.DbBuildError}});Object.defineProperty(exports,"ErrorCode",{enumerable:true,get:function(){return error_1.ErrorCode}});__exportStar(require("./common/constant"),exports);

@@ -6,2 +6,13 @@ import { AggregateCommand, QueryCommand } from './command/AbstractCommand';

export type UnchainCommand<T> = T extends QueryChain ? never : T;
export type AggregateExpression<T = any> = string | AggregateCommand | T;
export type AggregateExpressionPair = [AggregateExpression, AggregateExpression];
export type AggregateArrayExpression = AggregateExpression<any[]>;
export type AggregateNumberExpression = AggregateExpression<number>;
export type AggregateNumberExpressionPair = [AggregateNumberExpression, AggregateNumberExpression];
export type AggregateStringExpression = string | AggregateCommand;
export type AggregateStringExpressionPair = [AggregateStringExpression, AggregateStringExpression];
export type AggregateBooleanExpression = AggregateExpression<boolean>;
export type AggregateDateExpression = AggregateExpression<Date | number>;
export type AggregateDocumentExpression = AggregateExpression<object>;
export type AggregateExpressionRecord = Record<string, AggregateExpression>;
export interface SortOption {

@@ -78,5 +89,5 @@ field: string;

}
export type IndexOfArrayCommandParam = [string, any, number?, number?];
export type IndexOfArrayCommandParam = [AggregateArrayExpression, AggregateExpression, number?, number?];
export interface DateToStringCommandParam {
date: string;
date: AggregateDateExpression;
format?: string;

@@ -86,21 +97,21 @@ timezone?: string;

}
export type SliceCommandParam = [string, number, number?];
export type SliceCommandParam = [AggregateArrayExpression, AggregateNumberExpression, AggregateNumberExpression?];
export interface CondCommandObjectParam {
if: object | AggregateCommand;
if: AggregateBooleanExpression;
then: any;
else: any;
}
export type CondCommandArrayParam = [object | AggregateCommand, any, any];
export type CondCommandArrayParam = [AggregateBooleanExpression, any, any];
export type CondCommandParam = CondCommandObjectParam | CondCommandArrayParam;
export interface SwitchCommandBranch {
case: object | AggregateCommand;
then: any;
case: AggregateBooleanExpression;
then: AggregateExpression;
}
export interface SwitchCommandParam {
branches: Array<SwitchCommandBranch | [object | AggregateCommand, any]>;
default?: any;
branches: Array<SwitchCommandBranch | [AggregateBooleanExpression, AggregateExpression]>;
default?: AggregateExpression;
}
export interface LetCommandParam {
vars: Record<string, object | AggregateCommand>;
in: object | AggregateCommand;
vars: Record<string, AggregateExpression>;
in: AggregateExpression;
}

@@ -120,5 +131,13 @@ export interface ReplaceRootParam {

export interface MapParam {
input: string;
as: string;
in: AggregateCommand;
input: AggregateExpression;
as?: string;
in: AggregateExpression;
}
export interface AggregateDateWithTimezone {
date: AggregateDateExpression;
timezone?: string;
}
export type AggregateDateParam = AggregateDateExpression | AggregateDateWithTimezone;
export type SubstrCommandParam = [AggregateStringExpression, AggregateNumberExpression, AggregateNumberExpression];
export type SubstrBytesCommandParam = SubstrCommandParam;
export type SubtractCommandParam = [AggregateDateExpression, AggregateNumberExpression];
{
"name": "@alipay/faas-db-builder",
"version": "1.1.16-alpha.5",
"version": "1.1.16-alpha.6",
"description": "db builder",

@@ -40,6 +40,3 @@ "main": "lib/index.js",

"access": "public"
},
"dependencies": {
"bson": "^4.7.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc