@wix/wix-data-items-common 1.0.236 → 1.0.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/PipelineBuilder.js +2 -2
- package/dist/cjs/api/PipelineBuilder.js.map +1 -1
- package/dist/cjs/api/WixDataAggregate.js.map +1 -1
- package/dist/cjs/api/WixDataFilter.js.map +1 -1
- package/dist/cjs/api/WixDataQuery.js.map +1 -1
- package/dist/cjs/api/WixDataSearch.js.map +1 -1
- package/dist/cjs/api/expressions/expressions.js.map +1 -1
- package/dist/cjs/api/stages/FilterStage.js.map +1 -1
- package/dist/cjs/api/stages/GroupStage.js +3 -1
- package/dist/cjs/api/stages/GroupStage.js.map +1 -1
- package/dist/cjs/api/stages/ProjectStage.js.map +1 -1
- package/dist/cjs/api/stages/SortStage.js.map +1 -1
- package/dist/cjs/api/stages/stages.js.map +1 -1
- package/dist/cjs/api/types.js.map +1 -1
- package/dist/cjs/filter/WithFilter.js.map +1 -1
- package/dist/cjs/types/data-item-types.js.map +1 -1
- package/dist/esm/api/PipelineBuilder.js +2 -2
- package/dist/esm/api/stages/FilterStage.js.map +1 -1
- package/dist/esm/api/stages/GroupStage.js +3 -1
- package/dist/esm/api/stages/GroupStage.js.map +1 -1
- package/dist/esm/api/stages/ProjectStage.js.map +1 -1
- package/dist/types/api/PipelineBuilder.d.ts +4 -4
- package/dist/types/api/WixDataAggregate.d.ts +7 -7
- package/dist/types/api/WixDataFilter.d.ts +50 -84
- package/dist/types/api/WixDataFilter.d.ts.map +1 -1
- package/dist/types/api/WixDataQuery.d.ts +44 -71
- package/dist/types/api/WixDataQuery.d.ts.map +1 -1
- package/dist/types/api/WixDataSearch.d.ts +33 -33
- package/dist/types/api/expressions/expressions.d.ts +13 -13
- package/dist/types/api/stages/FilterStage.d.ts +70 -123
- package/dist/types/api/stages/FilterStage.d.ts.map +1 -1
- package/dist/types/api/stages/GroupStage.d.ts +20 -19
- package/dist/types/api/stages/GroupStage.d.ts.map +1 -1
- package/dist/types/api/stages/ProjectStage.d.ts +6 -7
- package/dist/types/api/stages/ProjectStage.d.ts.map +1 -1
- package/dist/types/api/stages/SortStage.d.ts +2 -2
- package/dist/types/api/stages/stages.d.ts +16 -8
- package/dist/types/api/stages/stages.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +2 -2
- package/dist/types/filter/WithFilter.d.ts +26 -42
- package/dist/types/filter/WithFilter.d.ts.map +1 -1
- package/dist/types/types/data-item-types.d.ts +6 -6
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Expression","require","expressions","exports","field","fieldPath","FieldExpressionImpl","text","value","TextExpressionImpl","numeric","NumericExpressionImpl","add","AddExpressionImpl","subtract","first","second","SubtractExpressionImpl","multiply","MultiplyExpressionImpl","divide","DivideExpressionImpl","sum","SumExpressionImpl","abs","expression","AbsExpressionImpl","mod","ModExpressionImpl","floor","FloorExpressionImpl","ceil","CeilExpressionImpl","concat","ConcatExpressionImpl","stringify","StringifyExpressionImpl","toLower","ToLowerExpressionImpl","toUpper","ToUpperExpressionImpl","substring","start","length","SubstringExpressionImpl","LengthExpressionImpl"],"sources":["../../../../src/api/expressions/expressions.ts"],"sourcesContent":["import {\n Expression,\n FieldExpression,\n FieldExpressionImpl,\n TextExpression,\n TextExpressionImpl,\n NumericExpression,\n NumericExpressionImpl,\n AddExpression,\n AddExpressionImpl,\n SubtractExpression,\n SubtractExpressionImpl,\n MultiplyExpression,\n MultiplyExpressionImpl,\n DivideExpression,\n DivideExpressionImpl,\n SumExpression,\n SumExpressionImpl,\n AbsExpression,\n AbsExpressionImpl,\n ModExpression,\n ModExpressionImpl,\n FloorExpression,\n FloorExpressionImpl,\n CeilExpression,\n CeilExpressionImpl,\n ConcatExpression,\n ConcatExpressionImpl,\n StringifyExpression,\n StringifyExpressionImpl,\n ToLowerExpression,\n ToLowerExpressionImpl,\n ToUpperExpression,\n ToUpperExpressionImpl,\n SubstringExpression,\n SubstringExpressionImpl,\n LengthExpression,\n LengthExpressionImpl,\n} from './Expression'\n\nexport const expressions: WixDataAggregatePipelineExpressions = {\n field: (fieldPath: string): FieldExpression =>\n new FieldExpressionImpl(fieldPath),\n text: (value: string): TextExpression => new TextExpressionImpl(value),\n numeric: (value: number): NumericExpression =>\n new NumericExpressionImpl(value),\n add: (...expressions: Expression[]): AddExpression =>\n new AddExpressionImpl(expressions),\n subtract: (first: Expression, second: Expression): SubtractExpression =>\n new SubtractExpressionImpl(first, second),\n multiply: (...expressions: Expression[]): MultiplyExpression =>\n new MultiplyExpressionImpl(expressions),\n divide: (first: Expression, second: Expression): DivideExpression =>\n new DivideExpressionImpl(first, second),\n sum: (...expressions: Expression[]): SumExpression =>\n new SumExpressionImpl(expressions),\n abs: (expression: Expression): AbsExpression =>\n new AbsExpressionImpl(expression),\n mod: (first: Expression, second: Expression): ModExpression =>\n new ModExpressionImpl(first, second),\n\n floor: (expression: Expression): FloorExpression =>\n new FloorExpressionImpl(expression),\n ceil: (expression: Expression): CeilExpression =>\n new CeilExpressionImpl(expression),\n concat: (...expressions: Expression[]): ConcatExpression =>\n new ConcatExpressionImpl(expressions),\n stringify: (expression: Expression): StringifyExpression =>\n new StringifyExpressionImpl(expression),\n toLower: (expression: Expression): ToLowerExpression =>\n new ToLowerExpressionImpl(expression),\n toUpper: (expression: Expression): ToUpperExpression =>\n new ToUpperExpressionImpl(expression),\n substring: (\n expression: Expression,\n start: Expression,\n length?: Expression\n ): SubstringExpression =>\n new SubstringExpressionImpl(expression, start, length),\n length: (expression: Expression): LengthExpression =>\n new LengthExpressionImpl(expression),\n}\n\n/**\n * @builder\n */\nexport interface WixDataAggregatePipelineExpressions {\n /**\n * Specifies which field to resolve.\n *\n * The `field()` method configures the aggregation pipeline to resolve the value of the specified field as an expression.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldPath - Path to the field containing the value to resolve. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n * @returns FieldExpression object.\n */\n field(fieldPath: string): FieldExpression\n /**\n * String.\n *\n * The `text()` method configures the aggregation pipeline to run the aggregation on the specified string.\n *\n * @public\n * @documentationMaturity preview\n * @param value - String to run the aggregation on.\n * @returns TextExpression object.\n */\n text(value: string): TextExpression\n /**\n * Number.\n *\n * The `numeric()` method configures the aggregation pipeline to run the aggregation on the specified number.\n *\n * @public\n * @documentationMaturity preview\n * @param value - Number to run the aggregation on.\n * @returns NumericExpression object.\n */\n numeric(value: number): NumericExpression\n /**\n * Adds the specified expressions.\n *\n * The `add()` method configures the aggregation pipeline to add the values of the specified expressions.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to add together. All expressions must resolve to numbers.\n * @returns AddExpression object.\n */\n add(...expressions: Expression[]): AddExpression\n /**\n * Subtracts 1 expression from another.\n *\n * The `subtract()` method configures the aggregation pipeline to subtract the second expression from the first expression.\n *\n * @public\n * @documentationMaturity preview\n * @param first - Expression to subtract `second` from. Expression must resolve to a number.\n * @param second - Expression to subtract from `first`. Expression must resolve to a number.\n * @returns SubtractExpression object.\n */\n subtract(first: Expression, second: Expression): SubtractExpression\n /**\n * Multiplies multiple expressions together.\n *\n * The `multiply()` method configures the aggregation pipeline to multiply the specified expressions.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to multiply. All expressions must resolve to numbers.\n * @returns MultiplyExpression object.\n */\n multiply(...expressions: Expression[]): MultiplyExpression\n /**\n * Divides 1 expression by another.\n *\n * The `divide()` method configures the aggregation pipeline to divide the first expression by the second expression.\n *\n * @public\n * @documentationMaturity preview\n * @param first - Expression to divide by `second`. Expression must resolve to a number.\n * @param second - Expression to divide `first` by. Expression must resolve to a non-zero number.\n * @returns DivideExpression object.\n */\n divide(first: Expression, second: Expression): DivideExpression\n /**\n * Calculates the total sum of multiple expressions.\n *\n * The `sum()` method configures the aggregation pipeline to calculate the total sum of the specified expressions.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to calculate the total sum of. All expressions must resolve to numbers.\n * @returns SumExpression object.\n */\n sum(...expressions: Expression[]): SumExpression\n /**\n * Finds the absolute value of an expression.\n *\n * The `abs()` method configures the aggregation pipeline to find the absolute value of the specified expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the absolute value of. Expression must resolve to a number.\n * @returns AbsExpression object.\n */\n abs(expression: Expression): AbsExpression\n /**\n * Finds the remainder when dividing 1 expression by another.\n *\n * The `mod()` method configures the aggregation pipeline to find the remainder when dividing the first expression by the second expression.\n *\n * @public\n * @documentationMaturity preview\n * @param first - Expression to divide by `second` to find the remainder. Expression must resolve to a number.\n * @param second - Expression to divide `first` by. Expression must resolve to a non-zero number.\n * @returns ModExpression object.\n */\n mod(first: Expression, second: Expression): ModExpression\n /**\n * Rounds an expression down to the nearest whole number.\n *\n * The `floor()` method configures the aggregation pipeline to round the specified expression down to the nearest integer.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to round down to the nearest whole number. Expression must resolve to a number.\n * @returns FloorExpression object.\n */\n floor(expression: Expression): FloorExpression\n /**\n * Rounds an expression up to the nearest whole number.\n *\n * The `ceil()` method configures the aggregation pipeline to round the specified expression up to the nearest integer.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to round up to the nearest whole number. Expression must resolve to a number.\n * @returns CeilExpression object.\n */\n ceil(expression: Expression): CeilExpression\n /**\n * Joins multiple expressions together to create a string\n *\n * The `concat()` method configures the aggregation pipeline to join multiple expressions together to create a new string.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to join together. All expressions must resolve to strings.\n * @returns ConcatExpression object.\n */\n concat(...expressions: Expression[]): ConcatExpression\n /**\n * Converts an expression to a string.\n *\n * The `stringify()` method configures the aggregation pipeline to convert the specified expression to a string.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to convert to a string.\n * @returns StringifyExpression object.\n */\n stringify(expression: Expression): StringifyExpression\n /**\n * Converts an expression to lowercase.\n *\n * The `toLower()` method configures the aggregation pipeline to convert the specified expression to lowercase.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to convert to lowercase. Expression must resolve to a string.\n * @returns ToLowerExpression object.\n */\n toLower(expression: Expression): ToLowerExpression\n /**\n * Converts an expression to uppercase.\n *\n * The `toUpper()` method configures the aggregation pipeline to convert the specified expression to uppercase.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to convert to uppercase. Expression must resolve to a string.\n * @returns ToUpperExpression object.\n */\n toUpper(expression: Expression): ToUpperExpression\n /**\n * Extracts a portion of a string expression.\n *\n * The `substring()` method configures the aggregation pipeline to extract a portion of the specified string expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to extract a substring from. Expression must resolve to a string.\n * @param start - Starting position of the substring to extract, specified in zero-based indexing. Expression must resolve to a number.\n * @param length - Number of characters to extract from the starting position. Expression must resolve to a number.\n * @returns SubstringExpression object.\n */\n substring(\n expression: Expression,\n start: Expression,\n length?: Expression\n ): SubstringExpression\n\n /**\n * Finds the length of a string expression.\n *\n * The `length()` method configures the aggregation pipeline to find the length of the specified expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the total number of characters of. Expression must resolve to a string.\n * @returns LengthExpression object.\n */\n length(expression: Expression): LengthExpression\n}\n"],"mappings":";;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAwCO,MAAMC,WAAgD,GAAAC,OAAA,CAAAD,WAAA,GAAG;EAC9DE,KAAK,EAAGC,SAAiB,IACvB,IAAIC,+BAAmB,CAACD,SAAS,CAAC;EACpCE,IAAI,EAAGC,KAAa,IAAqB,IAAIC,8BAAkB,CAACD,KAAK,CAAC;EACtEE,OAAO,EAAGF,KAAa,IACrB,IAAIG,iCAAqB,CAACH,KAAK,CAAC;EAClCI,GAAG,EAAEA,CAAC,GAAGV,WAAyB,KAChC,IAAIW,6BAAiB,CAACX,WAAW,CAAC;EACpCY,QAAQ,EAAEA,CAACC,KAAiB,EAAEC,MAAkB,KAC9C,IAAIC,kCAAsB,CAACF,KAAK,EAAEC,MAAM,CAAC;EAC3CE,QAAQ,EAAEA,CAAC,GAAGhB,WAAyB,KACrC,IAAIiB,kCAAsB,CAACjB,WAAW,CAAC;EACzCkB,MAAM,EAAEA,CAACL,KAAiB,EAAEC,MAAkB,KAC5C,IAAIK,gCAAoB,CAACN,KAAK,EAAEC,MAAM,CAAC;EACzCM,GAAG,EAAEA,CAAC,GAAGpB,WAAyB,KAChC,IAAIqB,6BAAiB,CAACrB,WAAW,CAAC;EACpCsB,GAAG,EAAGC,UAAsB,IAC1B,IAAIC,6BAAiB,CAACD,UAAU,CAAC;EACnCE,GAAG,EAAEA,CAACZ,KAAiB,EAAEC,MAAkB,KACzC,IAAIY,6BAAiB,CAACb,KAAK,EAAEC,MAAM,CAAC;EAEtCa,KAAK,EAAGJ,UAAsB,IAC5B,IAAIK,+BAAmB,CAACL,UAAU,CAAC;EACrCM,IAAI,EAAGN,UAAsB,IAC3B,IAAIO,8BAAkB,CAACP,UAAU,CAAC;EACpCQ,MAAM,EAAEA,CAAC,GAAG/B,WAAyB,KACnC,IAAIgC,gCAAoB,CAAChC,WAAW,CAAC;EACvCiC,SAAS,EAAGV,UAAsB,IAChC,IAAIW,mCAAuB,CAACX,UAAU,CAAC;EACzCY,OAAO,EAAGZ,UAAsB,IAC9B,IAAIa,iCAAqB,CAACb,UAAU,CAAC;EACvCc,OAAO,EAAGd,UAAsB,IAC9B,IAAIe,iCAAqB,CAACf,UAAU,CAAC;EACvCgB,SAAS,EAAEA,CACThB,UAAsB,EACtBiB,KAAiB,EACjBC,MAAmB,KAEnB,IAAIC,mCAAuB,CAACnB,UAAU,EAAEiB,KAAK,EAAEC,MAAM,CAAC;EACxDA,MAAM,EAAGlB,UAAsB,IAC7B,IAAIoB,gCAAoB,CAACpB,UAAU;AACvC,CAAC;;AAED;AACA;AACA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_Expression","require","expressions","exports","field","fieldPath","FieldExpressionImpl","text","value","TextExpressionImpl","numeric","NumericExpressionImpl","add","AddExpressionImpl","subtract","first","second","SubtractExpressionImpl","multiply","MultiplyExpressionImpl","divide","DivideExpressionImpl","sum","SumExpressionImpl","abs","expression","AbsExpressionImpl","mod","ModExpressionImpl","floor","FloorExpressionImpl","ceil","CeilExpressionImpl","concat","ConcatExpressionImpl","stringify","StringifyExpressionImpl","toLower","ToLowerExpressionImpl","toUpper","ToUpperExpressionImpl","substring","start","length","SubstringExpressionImpl","LengthExpressionImpl"],"sources":["../../../../src/api/expressions/expressions.ts"],"sourcesContent":["import {\n Expression,\n FieldExpression,\n FieldExpressionImpl,\n TextExpression,\n TextExpressionImpl,\n NumericExpression,\n NumericExpressionImpl,\n AddExpression,\n AddExpressionImpl,\n SubtractExpression,\n SubtractExpressionImpl,\n MultiplyExpression,\n MultiplyExpressionImpl,\n DivideExpression,\n DivideExpressionImpl,\n SumExpression,\n SumExpressionImpl,\n AbsExpression,\n AbsExpressionImpl,\n ModExpression,\n ModExpressionImpl,\n FloorExpression,\n FloorExpressionImpl,\n CeilExpression,\n CeilExpressionImpl,\n ConcatExpression,\n ConcatExpressionImpl,\n StringifyExpression,\n StringifyExpressionImpl,\n ToLowerExpression,\n ToLowerExpressionImpl,\n ToUpperExpression,\n ToUpperExpressionImpl,\n SubstringExpression,\n SubstringExpressionImpl,\n LengthExpression,\n LengthExpressionImpl,\n} from './Expression'\n\nexport const expressions: WixDataAggregatePipelineExpressions = {\n field: (fieldPath: string): FieldExpression =>\n new FieldExpressionImpl(fieldPath),\n text: (value: string): TextExpression => new TextExpressionImpl(value),\n numeric: (value: number): NumericExpression =>\n new NumericExpressionImpl(value),\n add: (...expressions: Expression[]): AddExpression =>\n new AddExpressionImpl(expressions),\n subtract: (first: Expression, second: Expression): SubtractExpression =>\n new SubtractExpressionImpl(first, second),\n multiply: (...expressions: Expression[]): MultiplyExpression =>\n new MultiplyExpressionImpl(expressions),\n divide: (first: Expression, second: Expression): DivideExpression =>\n new DivideExpressionImpl(first, second),\n sum: (...expressions: Expression[]): SumExpression =>\n new SumExpressionImpl(expressions),\n abs: (expression: Expression): AbsExpression =>\n new AbsExpressionImpl(expression),\n mod: (first: Expression, second: Expression): ModExpression =>\n new ModExpressionImpl(first, second),\n\n floor: (expression: Expression): FloorExpression =>\n new FloorExpressionImpl(expression),\n ceil: (expression: Expression): CeilExpression =>\n new CeilExpressionImpl(expression),\n concat: (...expressions: Expression[]): ConcatExpression =>\n new ConcatExpressionImpl(expressions),\n stringify: (expression: Expression): StringifyExpression =>\n new StringifyExpressionImpl(expression),\n toLower: (expression: Expression): ToLowerExpression =>\n new ToLowerExpressionImpl(expression),\n toUpper: (expression: Expression): ToUpperExpression =>\n new ToUpperExpressionImpl(expression),\n substring: (\n expression: Expression,\n start: Expression,\n length?: Expression\n ): SubstringExpression =>\n new SubstringExpressionImpl(expression, start, length),\n length: (expression: Expression): LengthExpression =>\n new LengthExpressionImpl(expression),\n}\n\n/**\n * @builder\n */\nexport interface WixDataAggregatePipelineExpressions {\n /**\n * Specifies which field to resolve.\n *\n * The `field()` method configures the aggregation pipeline to resolve the value of the specified field as an expression.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldPath - Path to the field containing the value to resolve. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n * @returns FieldExpression object.\n */\n field(fieldPath: string): FieldExpression\n /**\n * String.\n *\n * The `text()` method configures the aggregation pipeline to run the aggregation on the specified string.\n *\n * @public\n * @documentationMaturity preview\n * @param value - String to run the aggregation on.\n * @returns TextExpression object.\n */\n text(value: string): TextExpression\n /**\n * Number.\n *\n * The `numeric()` method configures the aggregation pipeline to run the aggregation on the specified number.\n *\n * @public\n * @documentationMaturity preview\n * @param value - Number to run the aggregation on.\n * @returns NumericExpression object.\n */\n numeric(value: number): NumericExpression\n /**\n * Adds the specified expressions.\n *\n * The `add()` method configures the aggregation pipeline to add the values of the specified expressions.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to add together. All expressions must resolve to numbers. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns AddExpression object.\n */\n add(...expressions: Expression[]): AddExpression\n /**\n * Subtracts 1 expression from another.\n *\n * The `subtract()` method configures the aggregation pipeline to subtract the second expression from the first expression.\n *\n * @public\n * @documentationMaturity preview\n * @param first - Expression to subtract `second` from. Expression must resolve to a number.\n * @param second - Expression to subtract from `first`. Expression must resolve to a number.\n * @returns SubtractExpression object.\n */\n subtract(first: Expression, second: Expression): SubtractExpression\n /**\n * Multiplies multiple expressions together.\n *\n * The `multiply()` method configures the aggregation pipeline to multiply the specified expressions.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to multiply. All expressions must resolve to numbers. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns MultiplyExpression object.\n */\n multiply(...expressions: Expression[]): MultiplyExpression\n /**\n * Divides 1 expression by another.\n *\n * The `divide()` method configures the aggregation pipeline to divide the first expression by the second expression.\n *\n * @public\n * @documentationMaturity preview\n * @param first - Expression to divide by `second`. Expression must resolve to a number.\n * @param second - Expression to divide `first` by. Expression must resolve to a non-zero number.\n * @returns DivideExpression object.\n */\n divide(first: Expression, second: Expression): DivideExpression\n /**\n * Calculates the total sum of multiple expressions.\n *\n * The `sum()` method configures the aggregation pipeline to calculate the total sum of the specified expressions.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to calculate the total sum of. All expressions must resolve to numbers. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns SumExpression object.\n */\n sum(...expressions: Expression[]): SumExpression\n /**\n * Finds the absolute value of an expression.\n *\n * The `abs()` method configures the aggregation pipeline to find the absolute value of the specified expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the absolute value of. Expression must resolve to a number. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns AbsExpression object.\n */\n abs(expression: Expression): AbsExpression\n /**\n * Finds the remainder when dividing 1 expression by another.\n *\n * The `mod()` method configures the aggregation pipeline to find the remainder when dividing the first expression by the second expression.\n *\n * @public\n * @documentationMaturity preview\n * @param first - Expression to divide by `second` to find the remainder. Expression must resolve to a number.\n * @param second - Expression to divide `first` by. Expression must resolve to a non-zero number.\n * @returns ModExpression object.\n */\n mod(first: Expression, second: Expression): ModExpression\n /**\n * Rounds an expression down to the nearest whole number.\n *\n * The `floor()` method configures the aggregation pipeline to round the specified expression down to the nearest integer.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to round down to the nearest whole number. Expression must resolve to a number. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns FloorExpression object.\n */\n floor(expression: Expression): FloorExpression\n /**\n * Rounds an expression up to the nearest whole number.\n *\n * The `ceil()` method configures the aggregation pipeline to round the specified expression up to the nearest integer.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to round up to the nearest whole number. Expression must resolve to a number. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns CeilExpression object.\n */\n ceil(expression: Expression): CeilExpression\n /**\n * Joins multiple expressions together to create a string.\n *\n * The `concat()` method configures the aggregation pipeline to join multiple expressions together to create a new string.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to join together. All expressions must resolve to strings. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns ConcatExpression object.\n */\n concat(...expressions: Expression[]): ConcatExpression\n /**\n * Converts an expression to a string.\n *\n * The `stringify()` method configures the aggregation pipeline to convert the specified expression to a string.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to convert to a string. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns StringifyExpression object.\n */\n stringify(expression: Expression): StringifyExpression\n /**\n * Converts an expression to lowercase.\n *\n * The `toLower()` method configures the aggregation pipeline to convert the specified expression to lowercase.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to convert to lowercase. Expression must resolve to a string. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns ToLowerExpression object.\n */\n toLower(expression: Expression): ToLowerExpression\n /**\n * Converts an expression to uppercase.\n *\n * The `toUpper()` method configures the aggregation pipeline to convert the specified expression to uppercase.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to convert to uppercase. Expression must resolve to a string. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns ToUpperExpression object.\n */\n toUpper(expression: Expression): ToUpperExpression\n /**\n * Extracts a portion of a string expression.\n *\n * The `substring()` method configures the aggregation pipeline to extract a portion of the specified string expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to extract a substring from. Expression must resolve to a string. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param start - Starting position of the substring to extract, specified in zero-based indexing. Expression must resolve to a number.\n * @param length - Number of characters to extract from the starting position. Expression must resolve to a number.\n * @returns SubstringExpression object.\n */\n substring(\n expression: Expression,\n start: Expression,\n length?: Expression\n ): SubstringExpression\n\n /**\n * Finds the length of a string expression.\n *\n * The `length()` method configures the aggregation pipeline to find the length of the specified expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the total number of characters of. Expression must resolve to a string. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @returns LengthExpression object.\n */\n length(expression: Expression): LengthExpression\n}\n"],"mappings":";;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAwCO,MAAMC,WAAgD,GAAAC,OAAA,CAAAD,WAAA,GAAG;EAC9DE,KAAK,EAAGC,SAAiB,IACvB,IAAIC,+BAAmB,CAACD,SAAS,CAAC;EACpCE,IAAI,EAAGC,KAAa,IAAqB,IAAIC,8BAAkB,CAACD,KAAK,CAAC;EACtEE,OAAO,EAAGF,KAAa,IACrB,IAAIG,iCAAqB,CAACH,KAAK,CAAC;EAClCI,GAAG,EAAEA,CAAC,GAAGV,WAAyB,KAChC,IAAIW,6BAAiB,CAACX,WAAW,CAAC;EACpCY,QAAQ,EAAEA,CAACC,KAAiB,EAAEC,MAAkB,KAC9C,IAAIC,kCAAsB,CAACF,KAAK,EAAEC,MAAM,CAAC;EAC3CE,QAAQ,EAAEA,CAAC,GAAGhB,WAAyB,KACrC,IAAIiB,kCAAsB,CAACjB,WAAW,CAAC;EACzCkB,MAAM,EAAEA,CAACL,KAAiB,EAAEC,MAAkB,KAC5C,IAAIK,gCAAoB,CAACN,KAAK,EAAEC,MAAM,CAAC;EACzCM,GAAG,EAAEA,CAAC,GAAGpB,WAAyB,KAChC,IAAIqB,6BAAiB,CAACrB,WAAW,CAAC;EACpCsB,GAAG,EAAGC,UAAsB,IAC1B,IAAIC,6BAAiB,CAACD,UAAU,CAAC;EACnCE,GAAG,EAAEA,CAACZ,KAAiB,EAAEC,MAAkB,KACzC,IAAIY,6BAAiB,CAACb,KAAK,EAAEC,MAAM,CAAC;EAEtCa,KAAK,EAAGJ,UAAsB,IAC5B,IAAIK,+BAAmB,CAACL,UAAU,CAAC;EACrCM,IAAI,EAAGN,UAAsB,IAC3B,IAAIO,8BAAkB,CAACP,UAAU,CAAC;EACpCQ,MAAM,EAAEA,CAAC,GAAG/B,WAAyB,KACnC,IAAIgC,gCAAoB,CAAChC,WAAW,CAAC;EACvCiC,SAAS,EAAGV,UAAsB,IAChC,IAAIW,mCAAuB,CAACX,UAAU,CAAC;EACzCY,OAAO,EAAGZ,UAAsB,IAC9B,IAAIa,iCAAqB,CAACb,UAAU,CAAC;EACvCc,OAAO,EAAGd,UAAsB,IAC9B,IAAIe,iCAAqB,CAACf,UAAU,CAAC;EACvCgB,SAAS,EAAEA,CACThB,UAAsB,EACtBiB,KAAiB,EACjBC,MAAmB,KAEnB,IAAIC,mCAAuB,CAACnB,UAAU,EAAEiB,KAAK,EAAEC,MAAM,CAAC;EACxDA,MAAM,EAAGlB,UAAsB,IAC7B,IAAIoB,gCAAoB,CAACpB,UAAU;AACvC,CAAC;;AAED;AACA;AACA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_QueryBase","require","FilterStageImpl","QueryBase","constructor","origin","collectionName","filterBuilder","copy","params","invalidArguments","build","filter","exports"],"sources":["../../../../src/api/stages/FilterStage.ts"],"sourcesContent":["import { QueryBase } from '../QueryBase'\nimport { PlatformizedFilterBuilder, WithFilter } from '../../filter'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\ntype Comparable = string | number | Date\n\n/**\n * @builder\n * Filter stage for aggregate pipeline operations. This interface provides filtering capabilities\n * specifically designed for use within aggregate pipelines, typically used with `stages.filter()`\n * in pipeline arrays to refine data based on specified conditions.\n */\nexport interface FilterStage extends PipelineStage, WithFilter<FilterStage> {\n /**\n * @internal\n */\n readonly filterTree: Record<string, any>\n\n /**\n * @internal\n */\n readonly invalidArguments: string[]\n\n /**\n * Filters pipeline data to match items whose specified field value equals the specified value.\n *\n * The `eq()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type array, `eq()` includes the item as long as at least one array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to compare with.\n * @requiredField value\n * @returns Refined filter.\n */\n eq(field: string, value: any): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value does not equal the specified value.\n *\n * The `ne()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of `field` is an array, `ne()` includes items\n * in which none of the elements of the array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ne(field: string, value: any): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is greater than or equal to the specified\n * value.\n *\n * The `ge()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ge(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is greater than the specified value.\n *\n * The `gt()` method refines this aggregate pipeline filter to only match\n * items where the value of the specified field is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n gt(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is less than or equal to the specified\n * value.\n *\n * The `le()` method refines this aggregate pipeline filter to only match\n * items where the value of the specified field is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n le(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is less than the specified value.\n *\n * The `lt()` method refines this aggregate pipeline filter to only match\n * items where the value of the specified field is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n lt(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field has any value.\n *\n * The `isNotEmpty()` method refines this aggregate pipeline filter to only match items where the\n * value of the specified field is not `null` or `undefined`.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns Refined filter.\n */\n isNotEmpty(field: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field does not exist or does not have any value.\n *\n * The `isEmpty()` method refines this aggregate pipeline filter to only match items where the\n * value of the specified field is `null` or `undefined` or the field does\n * not exist.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined filter.\n */\n isEmpty(field: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value starts with a specified string.\n *\n * The `startsWith()` method refines this aggregate pipeline filter to\n * only match items where the value of the specified field starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the `value` parameter.\n * @requiredField field\n * @param value - Value to look for at the beginning of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n startsWith(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value ends with a specified string.\n *\n * The `endsWith()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - Value to look for at the end of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n endsWith(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value contains the specified value.\n *\n * The `contains()` method refines the aggregate pipeline filter to only match items for which the value of the specified field contains the specified value. `contains()` is not case-sensitive, so the value `sunday` is considered to contain the value `Sun`.\n *\n * You can use `contains()` with a field whose type is a string or a reference. However, for fields whose type is reference, `contains()` matches by the ID of the referenced item as a string. Instead, use the [`eq()`](https://dev.wix.com/docs/sdk/backend-modules/data/wix-data-items-sdk-1-0-0/wix-data-filter/eq) method.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the provided value.\n * @requiredField field\n * @param value - Value to locate in the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n contains(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` method refines this aggregate pipeline filter to\n * only match items where the value of the specified field equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified field contains multiple references, pass item IDs in the\n * `value` field. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasSome(field: string, ...values: Comparable[]): FilterStage\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: Comparable[]): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` method refines this aggregate pipeline filter to\n * only match items where the value of the specified field equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `values`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasAll(field: string, ...values: Comparable[]): FilterStage\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: Comparable[]): FilterStage\n\n /**\n * Adds an `or` condition to the aggregate pipeline filter.\n *\n * The `or()` method adds an inclusive `or` condition to this pipeline filter. A filter\n * with an `or` returns all the items that match the filter as defined up to\n * the `or` method, the items that match the filter passed to the `or`\n * method, and the items that match both.\n *\n * The `or()` method is designed to work with 2 or more queries or filters.\n * If you use it on its own, it will return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n or(filter: FilterStage): FilterStage\n\n /**\n * Adds an `and` condition to the aggregate pipeline filter.\n *\n * A pipeline filter with an `and` condition returns all items that meet the conditions defined on both sides of the condition.\n *\n * Use the `and()` method when performing compound queries. For example, the final filter in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n *\n * ```js\n * let statusFilter = stages.filter()\n * .eq(\"status\", \"pending\")\n * .or(stages.filter().eq(\"status\", \"rejected\"));\n *\n * let ageFilter = stages.filter()\n * .lt(\"age\", 25)\n * .or(stages.filter().gt(\"age\", 65));\n *\n * let statusAndAgeFilter = statusFilter.and(ageFilter);\n * ```\n *\n * > **Notes**:\n * > - The `and()` method is designed to work with 2 or more queries or filters. If used with a single query or filter, it returns all items in a collection.\n * > - When chaining multiple `FilterStage` methods to a filter, an `and` condition is implied. In such cases, you do not need to call the `and()` method explicitly. For example, this filter returns results where an item `status` is `active` and `age` is greater than 25:\n *\n * ```js\n * stages.filter().eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * @public\n * @documentationMaturity preview\n * @param filter - `FilterStage` used with an `and` condition.\n * @requiredField filter\n * @returns The compound filter.\n */\n and(filter: FilterStage): FilterStage\n\n /**\n * Adds a `not` condition to the aggregate pipeline filter.\n *\n * The `not()` method adds a `not` condition to this pipeline filter. A filter with a `not`\n * returns all the items that match the filter as defined up to the `not`\n * method, but don't match the filter passed to the `not` method.\n *\n * If the filter only contains a `not()` method, it returns all the items\n * that don't match the filter defined by the `not` method.\n *\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n not(filter: FilterStage): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is within the defined range.\n *\n * The `between()` method refines this aggregate pipeline filter to match items for which the value of the specified field is greater than or equal to `rangeStart` and less than `rangeEnd`. The method only compares values of [the same type](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-type).\n *\n * The following types can be compared:\n * - Number: Compared numerically.\n * - Date: Compared as JavaScript Date objects.\n * - String: Compared lexicographically:\n * - `\"A\"` and `\"M\"` are considered between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are considered between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n *\n * > **Note**: Items that do not have a value for the specified field are considered as the lowest comparable value and are ranked last.\n *\n * @public\n * @documentationMaturity preview\n * @param field - Field to compare with `rangeStart` and `rangeEnd`.\n * @requiredField field\n * @param rangeStart - Starting value of the range to match.\n * @requiredField rangeStart\n * @param rangeEnd - Ending value of the range to match.\n * @requiredField rangeEnd\n * @returns Refined filter.\n */\n between(\n field: string,\n rangeStart: string | number | Date,\n rangeEnd: string | number | Date\n ): FilterStage\n}\n\nexport class FilterStageImpl\n extends QueryBase<FilterStageImpl>\n implements FilterStage\n{\n constructor(origin?: {\n collectionName?: string\n filterBuilder?: PlatformizedFilterBuilder\n }) {\n super({\n collectionName: origin?.collectionName || '',\n filterBuilder: origin?.filterBuilder,\n })\n }\n\n protected copy(params: any): FilterStageImpl {\n return new FilterStageImpl({\n collectionName: this.collectionName,\n filterBuilder: params.filterBuilder || this.filterBuilder,\n })\n }\n\n get invalidArguments(): string[] {\n return []\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return { filter: this.filterBuilder.build() }\n }\n}\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAOA;AACA;AACA;AACA;AACA;AACA;;AAubO,MAAMC,eAAe,SAClBC,oBAAS,CAEnB;EACEC,WAAWA,CAACC,MAGX,EAAE;IACD,KAAK,CAAC;MACJC,cAAc,EAAE,CAAAD,MAAM,oBAANA,MAAM,CAAEC,cAAc,KAAI,EAAE;MAC5CC,aAAa,EAAEF,MAAM,oBAANA,MAAM,CAAEE;IACzB,CAAC,CAAC;EACJ;EAEUC,IAAIA,CAACC,MAAW,EAAmB;IAC3C,OAAO,IAAIP,eAAe,CAAC;MACzBI,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCC,aAAa,EAAEE,MAAM,CAACF,aAAa,IAAI,IAAI,CAACA;IAC9C,CAAC,CAAC;EACJ;EAEA,IAAIG,gBAAgBA,CAAA,EAAa;IAC/B,OAAO,EAAE;EACX;;EAEA;EACAC,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,MAAM,EAAE,IAAI,CAACL,aAAa,CAACI,KAAK,CAAC;IAAE,CAAC;EAC/C;AACF;AAACE,OAAA,CAAAX,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_QueryBase","require","FilterStageImpl","QueryBase","constructor","origin","collectionName","filterBuilder","copy","params","invalidArguments","build","filter","exports"],"sources":["../../../../src/api/stages/FilterStage.ts"],"sourcesContent":["import { QueryBase } from '../QueryBase'\nimport { PlatformizedFilterBuilder, WithFilter } from '../../filter'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\ntype Comparable = string | number | Date\n\n/**\n * @builder\n * Filter stage for aggregate pipeline operations. This interface provides filtering capabilities\n * specifically designed for use within aggregate pipelines, typically used with `stages.filter()`\n * in pipeline arrays to refine data based on specified conditions.\n */\nexport interface FilterStage extends PipelineStage, WithFilter<FilterStage> {\n /**\n * @internal\n */\n readonly filterTree: Record<string, any>\n\n /**\n * @internal\n */\n readonly invalidArguments: string[]\n\n /**\n * Filters pipeline data to match items where the value of the specified field equals the specified value.\n *\n * The `eq()` method refines the filter to only match items where the value of the specified field equals the specified value.\n *\n * It only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored as a string does not match the same number stored as a number.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not considered equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type array, `eq()` includes the item as long as at least one array element matches the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified value.\n * @requiredField field\n * @param value - Value to compare with.\n * @requiredField value\n * @returns Refined filter.\n */\n eq(field: string, value: any): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field does not equal the specified value.\n *\n * The `ne()` method refines the filter to only match items where the value of the specified field does not equal the specified value.\n *\n * It only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored as a string is considered not equal to the same number stored as a number.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not considered equal to `\"Text\"`.\n *\n * If the value of `field` is an array, `ne()` matches items where none of the array's elements match the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified value.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ne(field: string, value: any): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field is greater than or equal to the specified value.\n *\n * The `ge()` method refines the filter to only match items where the value of the specified field is greater than or equal to the specified value.\n *\n * It only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored as a string does not match the same number stored as a string.\n *\n * If a field contains a number as a string, that value is compared alphabetically and not numerically. Items that do not have a value for the specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than), but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified value.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ge(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field is greater than the specified value.\n *\n * The `gt()` method refines the filter to only match items where the value of the specified field is greater than the specified value.\n *\n * It only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored as a string does not match the same number stored as a string.\n *\n * If a field contains a number as a string, that value is compared alphabetically and not numerically. Items that do not have a value for the specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified value.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n gt(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field is less than or equal to the specified value.\n *\n * The `le()` method refines the filter to only match items where the value of the specified field is less than or equal to the specified value.\n *\n * It only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored as a string does not match the same number stored as a string.\n *\n * If a field contains a number as a string, that value is compared alphabetically and not numerically. Items that do not have a value for the specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than), but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified value.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n le(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field is less than the specified value.\n *\n * The `lt()` method refines the filter to only match items where the value of the specified field is less than the specified value.\n *\n * It only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored as a string does not match the same number stored as a string.\n *\n * If a field contains a number as a string, that value is compared alphabetically and not numerically. Items that do not have a value for the specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified value.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n lt(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field has any value.\n *\n * The `isNotEmpty()` method refines the aggregate pipeline filter to only match items where the\n * value of the specified field is not `null` or `undefined`.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field to check for a value.\n * @requiredField field\n * @returns Refined filter.\n */\n isNotEmpty(field: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field does not exist or does not have any value.\n *\n * The `isEmpty()` method refines the aggregate pipeline filter to only match items where the value of the specified field is `null` or `undefined` or the field does not exist.\n *\n * If the field contains any value at all for a given item, including an empty string or an invalid value, that item does not match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field to check for a value.\n * @requiredField field\n * @returns Refined filter.\n */\n isEmpty(field: string): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field starts with a specified value.\n *\n * The `startsWith()` method refines the filter to only match items where the value of the specified field starts with the specified value. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` is considered to start with `\"tex\"`.\n *\n * You can only use `startsWith()` with a [field of type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data) string or reference. When matching a field of type reference, `startsWith()` matches by the ID of the referenced item as a string.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified value.\n * @requiredField field\n * @param value - Value to look for at the beginning of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n startsWith(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field ends with a specified value.\n *\n * The `endsWith()` method refines the filter to only match items where the value of the specified field ends with the specified value. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` is considered to end with `\"ext\"`.\n *\n * You can only use `endsWith()` with a [field of type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data) string or reference. When matching a field of type reference, `endsWith()` matches by the ID of the referenced item as a string.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified value.\n * @requiredField field\n * @param value - Value to look for at the end of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n endsWith(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field contains the specified value.\n *\n * The `contains()` method refines the aggregate pipeline filter to only match items for which the value of the specified field contains the specified value. `contains()` is not case-sensitive, so the value `sunday` is considered to contain the value `Sun`.\n *\n * You can use `contains()` with a [field of type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data) string or reference. For fields of type reference, `contains()` matches by the ID of the referenced item as a string. To match by other data types, use the [`eq()`](https://dev.wix.com/docs/sdk/backend-modules/data/wix-data-items-sdk-1-0-0/wix-data-filter/eq) method.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is matched with the specified value.\n * @requiredField field\n * @param value - Value to locate in the specified field.\n * @requiredField value\n * @returns Refined filter.\n */\n contains(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field equals any of the specified values.\n *\n * The `hasSome()` method refines the filter to only match items where the value of the specified field contains any of the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not considered equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasSome()` matches items where any of the array's elements match any of the specified values.\n *\n * If the specified field contains multiple references, specify their item IDs. In such a case, `hasSome()` matches if any of the references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of strings, numbers, or dates.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified values.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasSome(field: string, ...values: Comparable[]): FilterStage\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: Comparable[]): FilterStage\n\n /**\n * Filters pipeline data to match items where the values of the specified field equal all of the specified values.\n *\n * The `hasAll()` method refines the filter to only match items where the value of the specified field equals all of the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not considered equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasAll()` matches items where all the elements of that array match all of the specified values.\n *\n * You can specify a list of values to match by providing an array of strings, numbers, or dates.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the specified values.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns Refined filter.\n */\n hasAll(field: string, ...values: Comparable[]): FilterStage\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: Comparable[]): FilterStage\n\n /**\n * Adds an `or` condition to the aggregate pipeline filter.\n *\n * The `or()` method adds an inclusive `or` condition to this pipeline filter. A filter\n * with an `or` returns all the items that match the filter as defined up to\n * the `or` method, the items that match the filter passed to the `or`\n * method, and the items that match both.\n *\n * The `or()` method is designed to work with 2 or more queries or filters.\n * If you use it on its own, it will return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n or(filter: FilterStage): FilterStage\n\n /**\n * Adds an `and` condition to the aggregate pipeline filter.\n *\n * A pipeline filter with an `and` condition returns all items that meet the conditions defined on both sides of the condition.\n *\n * Use the `and()` method when performing compound queries. For example, the final filter in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n *\n * ```js\n * let statusFilter = stages.filter()\n * .eq(\"status\", \"pending\")\n * .or(stages.filter().eq(\"status\", \"rejected\"));\n *\n * let ageFilter = stages.filter()\n * .lt(\"age\", 25)\n * .or(stages.filter().gt(\"age\", 65));\n *\n * let statusAndAgeFilter = statusFilter.and(ageFilter);\n * ```\n *\n * > **Notes**:\n * > - The `and()` method is designed to work with 2 or more queries or filters. If used with a single query or filter, it returns all items in a collection.\n * > - When chaining multiple `FilterStage` methods to a filter, an `and` condition is implied. In such cases, you do not need to call the `and()` method explicitly. For example, this filter returns results where an item `status` is `active` and `age` is greater than 25:\n *\n * ```js\n * stages.filter().eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * @public\n * @documentationMaturity preview\n * @param filter - `FilterStage` used with an `and` condition.\n * @requiredField filter\n * @returns The compound filter.\n */\n and(filter: FilterStage): FilterStage\n\n /**\n * Adds a `not` condition to the aggregate pipeline filter.\n *\n * The `not()` method adds a `not` condition to this pipeline filter. A filter with a `not`\n * returns all the items that match the filter as defined up to the `not`\n * method, but don't match the filter passed to the `not` method.\n *\n * If the filter only contains a `not()` method, it returns all the items\n * that don't match the filter defined by the `not` method.\n *\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n not(filter: FilterStage): FilterStage\n\n /**\n * Filters pipeline data to match items where the value of the specified field is within the defined range.\n *\n * The `between()` method refines the filter to match items for which the value of the specified field is greater than or equal to `rangeStart` and less than `rangeEnd`. The method only compares values of [the same type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data).\n *\n * The following types can be compared:\n * - Number: Compared numerically.\n * - Date: Compared as JavaScript Date objects.\n * - String: Compared lexicographically:\n * - `\"A\"` and `\"M\"` are considered between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are considered between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n *\n * > **Note**: Items that do not have a value for the specified field are considered as the lowest comparable value and are ranked last.\n *\n * @public\n * @documentationMaturity preview\n * @param field - Field to compare with `rangeStart` and `rangeEnd`.\n * @requiredField field\n * @param rangeStart - Starting value of the range to match.\n * @requiredField rangeStart\n * @param rangeEnd - Ending value of the range to match.\n * @requiredField rangeEnd\n * @returns Refined filter.\n */\n between(\n field: string,\n rangeStart: string | number | Date,\n rangeEnd: string | number | Date\n ): FilterStage\n}\n\nexport class FilterStageImpl\n extends QueryBase<FilterStageImpl>\n implements FilterStage\n{\n constructor(origin?: {\n collectionName?: string\n filterBuilder?: PlatformizedFilterBuilder\n }) {\n super({\n collectionName: origin?.collectionName || '',\n filterBuilder: origin?.filterBuilder,\n })\n }\n\n protected copy(params: any): FilterStageImpl {\n return new FilterStageImpl({\n collectionName: this.collectionName,\n filterBuilder: params.filterBuilder || this.filterBuilder,\n })\n }\n\n get invalidArguments(): string[] {\n return []\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return { filter: this.filterBuilder.build() }\n }\n}\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAOA;AACA;AACA;AACA;AACA;AACA;;AAkYO,MAAMC,eAAe,SAClBC,oBAAS,CAEnB;EACEC,WAAWA,CAACC,MAGX,EAAE;IACD,KAAK,CAAC;MACJC,cAAc,EAAE,CAAAD,MAAM,oBAANA,MAAM,CAAEC,cAAc,KAAI,EAAE;MAC5CC,aAAa,EAAEF,MAAM,oBAANA,MAAM,CAAEE;IACzB,CAAC,CAAC;EACJ;EAEUC,IAAIA,CAACC,MAAW,EAAmB;IAC3C,OAAO,IAAIP,eAAe,CAAC;MACzBI,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCC,aAAa,EAAEE,MAAM,CAACF,aAAa,IAAI,IAAI,CAACA;IAC9C,CAAC,CAAC;EACJ;EAEA,IAAIG,gBAAgBA,CAAA,EAAa;IAC/B,OAAO,EAAE;EACX;;EAEA;EACAC,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,MAAM,EAAE,IAAI,CAACL,aAAa,CAACI,KAAK,CAAC;IAAE,CAAC;EAC/C;AACF;AAACE,OAAA,CAAAX,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Expression","require","GroupStageImpl","constructor","_defineProperty2","default","by","expression","key","ids","push","sum","resultFieldName","addAccumulator","avg","min","max","count","NumericExpressionImpl","first","last","type","accumulators","build","group","groupIds","map","id","accumulator","exports"],"sources":["../../../../src/api/stages/GroupStage.ts"],"sourcesContent":["import { Expression, NumericExpressionImpl } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface GroupStage extends PipelineStage {\n /**\n * Specifies how to group items in the result.\n *\n * The `by()` method configures the aggregation pipeline to group items for which the specified `expression` resolves to the same value. The `key` and resolved `expression` determine the result item's unique `_id` property.\n *\n * > **Note**: When `by()` is not called or when called with no parameters, all items are placed in a single group.\n *\n * @param expression - Expression to determine the grouping value. Items with matching values are grouped together.\n * @param key - Name of the field in the result that contains the grouping value.\n * @returns GroupStage object.\n */\n by(expression: Expression, key: string): GroupStage\n /**\n * Calculates the sum of the specified expression across all items in the group.\n *\n * The `sum()` method refines the aggregation pipeline to calculate the sum of the specified expression across all items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to calculate the group's total sum. Expression must resolve to a number.\n * @param resultFieldName - Field key in the output item to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n sum(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Calculates the average value across all items in the group based on the specified expression.\n *\n * The `avg()` method refines the aggregation pipeline to calculate the average value of the specified expression across all items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to calculate the group's average value. The expression must resolve to a number.\n * @param resultFieldName - Field key in the output item to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n avg(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Finds the minimum value across all items in the group.\n *\n * The `min()` method refines the aggregation pipeline to find the minimum value of the specified field across all the items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the group's minimum value. Expression must resolve to a comparable value, such as a number or string.\n * @param resultFieldName - Field key in the output item to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n min(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Finds the maximum value across all items in the group.\n *\n * The `max()` method refines the aggregation pipeline to find the maximum value of the specified field across all the items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the group's maximum value. Expression must resolve to a comparable value, such as a number or string.\n * @param resultFieldName - Field key in the output item to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n max(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Counts the number of items in the group.\n *\n * The `count()` method refines the aggregation pipeline to count the number of items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param resultFieldName - Field key in the output item to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n count(resultFieldName: string): GroupStage\n /**\n * Finds the first item in the group.\n *\n * The `first()` method refines the aggregation pipeline to find the first item in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the first item in the group.\n * @param resultFieldName - Field key in the output item to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n first(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Finds the last item in the group.\n *\n * The `last()` method refines the aggregation pipeline to find the last item in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the last item in the group.\n * @param resultFieldName - Field key in the output item to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n last(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Collects values from all items in the group into an array.\n *\n * The `push()` method refines the aggregation pipeline to collect values from all items in the group into an array.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to collect items into an array.\n * @param resultFieldName - Field key in the output item to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n\n * @returns GroupStage object.\n */\n push(expression: Expression, resultFieldName: string): GroupStage\n}\n\nexport class GroupStageImpl implements GroupStage {\n private ids: Id[] = []\n private accumulators: Accumulator[] = []\n\n by(expression: Expression, key: string): GroupStage {\n this.ids.push({ expression, key })\n return this\n }\n\n sum(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'sum', resultFieldName)\n }\n\n avg(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'avg', resultFieldName)\n }\n\n min(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'min', resultFieldName)\n }\n\n max(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'max', resultFieldName)\n }\n\n count(resultFieldName: string): GroupStage {\n return this.addAccumulator(\n new NumericExpressionImpl(1),\n 'sum',\n resultFieldName\n )\n }\n\n first(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'first', resultFieldName)\n }\n\n last(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'last', resultFieldName)\n }\n\n push(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'push', resultFieldName)\n }\n\n private addAccumulator(\n expression: Expression,\n type: AccumulatorType,\n resultFieldName: string\n ): GroupStage {\n this.accumulators.push({ type, expression, resultFieldName })\n return this\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return {\n group: {\n groupIds: this.ids.map((id) => ({\n expression: id.expression.build(),\n key: id.key,\n })),\n accumulators: this.accumulators.map((accumulator) => ({\n [accumulator.type]: {\n expression: accumulator.expression.build(),\n },\n resultFieldName: accumulator.resultFieldName,\n })),\n },\n }\n }\n}\n\ntype AccumulatorType = 'avg' | 'min' | 'max' | 'sum' | 'first' | 'last' | 'push'\n\ninterface Id {\n expression: Expression\n key: string\n}\n\ninterface Accumulator {\n type: AccumulatorType\n expression: Expression\n resultFieldName: string\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAIA;AACA;AACA;;AAgIO,MAAMC,cAAc,CAAuB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,eAC5B,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA,wBACgB,EAAE;EAAA;EAExCC,EAAEA,CAACC,UAAsB,EAAEC,GAAW,EAAc;IAClD,IAAI,CAACC,GAAG,CAACC,IAAI,CAAC;MAAEH,UAAU;MAAEC;IAAI,CAAC,CAAC;IAClC,OAAO,IAAI;EACb;EAEAG,GAAGA,CAACJ,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAE,GAAGA,CAACP,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAG,GAAGA,CAACR,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAI,GAAGA,CAACT,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAK,KAAKA,CAACL,eAAuB,EAAc;IACzC,OAAO,IAAI,CAACC,cAAc,CACxB,IAAIK,iCAAqB,CAAC,CAAC,CAAC,EAC5B,KAAK,EACLN,eACF,CAAC;EACH;EAEAO,KAAKA,CAACZ,UAAsB,EAAEK,eAAuB,EAAc;IACjE,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,OAAO,EAAEK,eAAe,CAAC;EAClE;EAEAQ,IAAIA,CAACb,UAAsB,EAAEK,eAAuB,EAAc;IAChE,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,MAAM,EAAEK,eAAe,CAAC;EACjE;EAEAF,IAAIA,CAACH,UAAsB,EAAEK,eAAuB,EAAc;IAChE,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,MAAM,EAAEK,eAAe,CAAC;EACjE;EAEQC,cAAcA,CACpBN,UAAsB,EACtBc,IAAqB,EACrBT,eAAuB,EACX;IACZ,IAAI,CAACU,YAAY,CAACZ,IAAI,CAAC;MAAEW,IAAI;MAAEd,UAAU;MAAEK;IAAgB,CAAC,CAAC;IAC7D,OAAO,IAAI;EACb;;EAEA;EACAW,KAAKA,CAAA,EAAmB;IACtB,OAAO;MACLC,KAAK,EAAE;QACLC,QAAQ,EAAE,IAAI,CAAChB,GAAG,CAACiB,GAAG,CAAEC,EAAE,KAAM;UAC9BpB,UAAU,EAAEoB,EAAE,CAACpB,UAAU,CAACgB,KAAK,CAAC,CAAC;UACjCf,GAAG,EAAEmB,EAAE,CAACnB;QACV,CAAC,CAAC,CAAC;QACHc,YAAY,EAAE,IAAI,CAACA,YAAY,CAACI,GAAG,CAAEE,WAAW,KAAM;UACpD,CAACA,WAAW,CAACP,IAAI,GAAG;YAClBd,UAAU,EAAEqB,WAAW,CAACrB,UAAU,CAACgB,KAAK,CAAC;UAC3C,CAAC;UACDX,eAAe,EAAEgB,WAAW,CAAChB;QAC/B,CAAC,CAAC;MACJ;IACF,CAAC;EACH;AACF;AAACiB,OAAA,CAAA3B,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_Expression","require","GroupStageImpl","constructor","_defineProperty2","default","by","expression","key","ids","push","sum","resultFieldName","addAccumulator","avg","min","max","count","NumericExpressionImpl","first","last","type","accumulators","build","group","groupIds","map","id","accumulator","exports"],"sources":["../../../../src/api/stages/GroupStage.ts"],"sourcesContent":["import { Expression, NumericExpressionImpl } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface GroupStage extends PipelineStage {\n /**\n * Specifies how to group items in the result.\n *\n * The `by()` method configures the aggregation pipeline to group items for which the specified `expression` resolves to the same value. The `key` and resolved `expression` determine the result item's unique `_id` property.\n *\n * > **Note**: When `by()` is not called or when it is called with no parameters, all items are placed in a single group.\n *\n * @param expression - Expression to determine the grouping value. Items with matching values are grouped together. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param key - Name of the field in the result that contains the grouping value.\n * @returns GroupStage object.\n */\n by(expression: Expression, key: string): GroupStage\n /**\n * Calculates the sum of the specified expression across all items in the group.\n *\n * The `sum()` method refines the aggregation pipeline to calculate the sum of the specified expression across all items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to calculate the group's total sum. Expression must resolve to a number. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param resultFieldName - Field to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n sum(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Calculates the average value across all items in the group based on the specified expression.\n *\n * The `avg()` method refines the aggregation pipeline to calculate the average value of the specified expression across all items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to calculate the group's average value. The expression must resolve to a number. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param resultFieldName - Field to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n avg(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Finds the minimum value across all items in the group.\n *\n * The `min()` method refines the aggregation pipeline to find the minimum value of the specified field across all the items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the group's minimum value. Expression must resolve to a comparable value, such as a number or string. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param resultFieldName - Field to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n min(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Finds the maximum value across all items in the group.\n *\n * The `max()` method refines the aggregation pipeline to find the maximum value of the specified field across all the items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the group's maximum value. Expression must resolve to a comparable value, such as a number or string. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param resultFieldName - Field to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n max(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Counts the number of items in the group.\n *\n * The `count()` method refines the aggregation pipeline to count the number of items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param resultFieldName - Field to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n count(resultFieldName: string): GroupStage\n /**\n * Finds the first item in the group.\n *\n * The `first()` method refines the aggregation pipeline to find the first item in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the first item in the group. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param resultFieldName - Field to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n first(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Finds the last item in the group.\n *\n * The `last()` method refines the aggregation pipeline to find the last item in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the last item in the group. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param resultFieldName - Field to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n last(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Collects values from all items in the group into an array.\n *\n * The `push()` method refines the aggregation pipeline to collect values from all items in the group into an array.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to collect items into an array. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param resultFieldName - Field to store the result in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns GroupStage object.\n */\n push(expression: Expression, resultFieldName: string): GroupStage\n}\n\nexport class GroupStageImpl implements GroupStage {\n private ids: Id[] = []\n private accumulators: Accumulator[] = []\n\n by(expression: Expression, key: string): GroupStage {\n this.ids.push({ expression, key })\n return this\n }\n\n sum(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'sum', resultFieldName)\n }\n\n avg(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'avg', resultFieldName)\n }\n\n min(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'min', resultFieldName)\n }\n\n max(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'max', resultFieldName)\n }\n\n count(resultFieldName: string): GroupStage {\n return this.addAccumulator(\n new NumericExpressionImpl(1),\n 'sum',\n resultFieldName\n )\n }\n\n first(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'first', resultFieldName)\n }\n\n last(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'last', resultFieldName)\n }\n\n push(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'push', resultFieldName)\n }\n\n private addAccumulator(\n expression: Expression,\n type: AccumulatorType,\n resultFieldName: string\n ): GroupStage {\n this.accumulators.push({ type, expression, resultFieldName })\n return this\n }\n\n /**\n * @internal\n */\n build(): apiTypes.Stage {\n return {\n group: {\n groupIds: this.ids.map((id) => ({\n expression: id.expression.build(),\n key: id.key,\n })),\n accumulators: this.accumulators.map((accumulator) => ({\n [accumulator.type]: {\n expression: accumulator.expression.build(),\n },\n resultFieldName: accumulator.resultFieldName,\n })),\n },\n }\n }\n}\n\ntype AccumulatorType = 'avg' | 'min' | 'max' | 'sum' | 'first' | 'last' | 'push'\n\ninterface Id {\n expression: Expression\n key: string\n}\n\ninterface Accumulator {\n type: AccumulatorType\n expression: Expression\n resultFieldName: string\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAIA;AACA;AACA;;AA+HO,MAAMC,cAAc,CAAuB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,eAC5B,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA,wBACgB,EAAE;EAAA;EAExCC,EAAEA,CAACC,UAAsB,EAAEC,GAAW,EAAc;IAClD,IAAI,CAACC,GAAG,CAACC,IAAI,CAAC;MAAEH,UAAU;MAAEC;IAAI,CAAC,CAAC;IAClC,OAAO,IAAI;EACb;EAEAG,GAAGA,CAACJ,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAE,GAAGA,CAACP,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAG,GAAGA,CAACR,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAI,GAAGA,CAACT,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAK,KAAKA,CAACL,eAAuB,EAAc;IACzC,OAAO,IAAI,CAACC,cAAc,CACxB,IAAIK,iCAAqB,CAAC,CAAC,CAAC,EAC5B,KAAK,EACLN,eACF,CAAC;EACH;EAEAO,KAAKA,CAACZ,UAAsB,EAAEK,eAAuB,EAAc;IACjE,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,OAAO,EAAEK,eAAe,CAAC;EAClE;EAEAQ,IAAIA,CAACb,UAAsB,EAAEK,eAAuB,EAAc;IAChE,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,MAAM,EAAEK,eAAe,CAAC;EACjE;EAEAF,IAAIA,CAACH,UAAsB,EAAEK,eAAuB,EAAc;IAChE,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,MAAM,EAAEK,eAAe,CAAC;EACjE;EAEQC,cAAcA,CACpBN,UAAsB,EACtBc,IAAqB,EACrBT,eAAuB,EACX;IACZ,IAAI,CAACU,YAAY,CAACZ,IAAI,CAAC;MAAEW,IAAI;MAAEd,UAAU;MAAEK;IAAgB,CAAC,CAAC;IAC7D,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACEW,KAAKA,CAAA,EAAmB;IACtB,OAAO;MACLC,KAAK,EAAE;QACLC,QAAQ,EAAE,IAAI,CAAChB,GAAG,CAACiB,GAAG,CAAEC,EAAE,KAAM;UAC9BpB,UAAU,EAAEoB,EAAE,CAACpB,UAAU,CAACgB,KAAK,CAAC,CAAC;UACjCf,GAAG,EAAEmB,EAAE,CAACnB;QACV,CAAC,CAAC,CAAC;QACHc,YAAY,EAAE,IAAI,CAACA,YAAY,CAACI,GAAG,CAAEE,WAAW,KAAM;UACpD,CAACA,WAAW,CAACP,IAAI,GAAG;YAClBd,UAAU,EAAEqB,WAAW,CAACrB,UAAU,CAACgB,KAAK,CAAC;UAC3C,CAAC;UACDX,eAAe,EAAEgB,WAAW,CAAChB;QAC/B,CAAC,CAAC;MACJ;IACF,CAAC;EACH;AACF;AAACiB,OAAA,CAAA3B,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ProjectStageImpl","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","reshape","expression","resultFieldName","addField","projectNested","stage","addNestedProjectionField","build","projection","exports"],"sources":["../../../../src/api/stages/ProjectStage.ts"],"sourcesContent":["import { Expression } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface ProjectStage extends PipelineStage {\n /**\n * @internal\n */\n fields: apiTypes.Field[]\n /**\n * Fields to include in the result.\n *\n * When specified, the result includes only the specified fields. All other fields are excluded.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldNames -
|
|
1
|
+
{"version":3,"names":["ProjectStageImpl","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","reshape","expression","resultFieldName","addField","projectNested","stage","addNestedProjectionField","build","projection","exports"],"sources":["../../../../src/api/stages/ProjectStage.ts"],"sourcesContent":["import { Expression } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface ProjectStage extends PipelineStage {\n /**\n * @internal\n */\n fields: apiTypes.Field[]\n /**\n * Fields to include in the result.\n *\n * When specified, the result includes only the specified fields. All other fields are excluded.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldNames - Fields to include in the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n include(...fieldNames: string[]): ProjectStage\n /**\n * Fields to exclude from the result.\n *\n * When specified, excludes the specified field from the result. All other fields are included.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldNames - Fields to exclude from the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n exclude(...fieldNames: string[]): ProjectStage\n /**\n * Reshapes a new field based on the specified expression. The result does not include the field used in the expression. For example, reshaping `basePrice` to add `tax` results in a new field `totalPrice` that does not include `basePrice` or `tax`.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to resolve. The result of the expression becomes the value of the new field. Learn more about using [expressions in aggregation pipelines](https://dev.wix.com/docs/sdk/backend-modules/data/items/wix-data-aggregate-pipeline-expressions/introduction).\n * @param resultFieldName - Field to create in the result.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n reshape(expression: Expression, resultFieldName: string): ProjectStage\n /**\n * Creates nested fields by including, excluding, or reshaping fields.\n *\n * @public\n * @documentationMaturity preview\n * @param stage - Projected stage to nest.\n * @param resultFieldName - Field to nest the projected stage in.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage\n}\n\nexport class ProjectStageImpl implements ProjectStage {\n fields: apiTypes.Field[] = []\n\n include(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ include: { fieldName } })\n })\n return this\n }\n\n exclude(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ exclude: { fieldName } })\n })\n return this\n }\n\n reshape(expression: Expression, resultFieldName: string): ProjectStage {\n this.addField(expression, resultFieldName)\n return this\n }\n\n projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage {\n return this.addNestedProjectionField(resultFieldName, stage.fields)\n }\n\n private addField(\n expression: Expression,\n resultFieldName: string\n ): ProjectStage {\n this.fields.push({\n reshape: { resultFieldName, expression: expression.build() },\n })\n return this\n }\n\n private addNestedProjectionField(\n resultFieldName: string,\n fields: apiTypes.Field[]\n ): ProjectStage {\n this.fields.push({ projectNested: { resultFieldName, fields } })\n return this\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return { projection: { fields: this.fields } }\n }\n}\n"],"mappings":";;;;;;AAIA;AACA;AACA;;AA0DO,MAAMA,gBAAgB,CAAyB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,kBACzB,EAAE;EAAA;EAE7BC,OAAOA,CAAC,GAAGC,UAAoB,EAAgB;IAC7CA,UAAU,CAACC,OAAO,CAAEC,SAAS,IAAK;MAChC,IAAI,CAACC,MAAM,CAACC,IAAI,CAAC;QAAEL,OAAO,EAAE;UAAEG;QAAU;MAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEAG,OAAOA,CAAC,GAAGL,UAAoB,EAAgB;IAC7CA,UAAU,CAACC,OAAO,CAAEC,SAAS,IAAK;MAChC,IAAI,CAACC,MAAM,CAACC,IAAI,CAAC;QAAEC,OAAO,EAAE;UAAEH;QAAU;MAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEAI,OAAOA,CAACC,UAAsB,EAAEC,eAAuB,EAAgB;IACrE,IAAI,CAACC,QAAQ,CAACF,UAAU,EAAEC,eAAe,CAAC;IAC1C,OAAO,IAAI;EACb;EAEAE,aAAaA,CAACC,KAAmB,EAAEH,eAAuB,EAAgB;IACxE,OAAO,IAAI,CAACI,wBAAwB,CAACJ,eAAe,EAAEG,KAAK,CAACR,MAAM,CAAC;EACrE;EAEQM,QAAQA,CACdF,UAAsB,EACtBC,eAAuB,EACT;IACd,IAAI,CAACL,MAAM,CAACC,IAAI,CAAC;MACfE,OAAO,EAAE;QAAEE,eAAe;QAAED,UAAU,EAAEA,UAAU,CAACM,KAAK,CAAC;MAAE;IAC7D,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEQD,wBAAwBA,CAC9BJ,eAAuB,EACvBL,MAAwB,EACV;IACd,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC;MAAEM,aAAa,EAAE;QAAEF,eAAe;QAAEL;MAAO;IAAE,CAAC,CAAC;IAChE,OAAO,IAAI;EACb;;EAEA;EACAU,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,UAAU,EAAE;QAAEX,MAAM,EAAE,IAAI,CAACA;MAAO;IAAE,CAAC;EAChD;AACF;AAACY,OAAA,CAAApB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["apiTypes","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SortStageImpl","constructor","_defineProperty2","ascending","fields","forEach","field","sortFields","push","fieldName","order","SortOrder","ASC","descending","DESC","build","sort","values","exports"],"sources":["../../../../src/api/stages/SortStage.ts"],"sourcesContent":["import { PipelineStage } from './stages'\nimport * as apiTypes from '../../types/data-item-types'\n\n/**\n * @builder\n */\nexport interface SortStage extends PipelineStage {\n /**\n * Adds a sort stage that sorts the aggregation results by the specified fields in ascending order.\n *\n * The `ascending()` method refines the aggregation to sort results in ascending order of the specified fields. If you specify more than one field, `ascending()` sorts the results in ascending order by each field in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes after `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a property contains a number as a String, that value is sorted alphabetically and not numerically. Items that do not have a value for the specified sort property are ranked lowest.\n *\n * @public\n * @documentationMaturity preview\n * @param fields - Fields
|
|
1
|
+
{"version":3,"names":["apiTypes","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SortStageImpl","constructor","_defineProperty2","ascending","fields","forEach","field","sortFields","push","fieldName","order","SortOrder","ASC","descending","DESC","build","sort","values","exports"],"sources":["../../../../src/api/stages/SortStage.ts"],"sourcesContent":["import { PipelineStage } from './stages'\nimport * as apiTypes from '../../types/data-item-types'\n\n/**\n * @builder\n */\nexport interface SortStage extends PipelineStage {\n /**\n * Adds a sort stage that sorts the aggregation results by the specified fields in ascending order.\n *\n * The `ascending()` method refines the aggregation to sort results in ascending order of the specified fields. If you specify more than one field, `ascending()` sorts the results in ascending order by each field in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes after `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a property contains a number as a String, that value is sorted alphabetically and not numerically. Items that do not have a value for the specified sort property are ranked lowest.\n *\n * @public\n * @documentationMaturity preview\n * @param fields - Fields to sort by.\n * @returns SortStage object.\n */\n ascending(...fields: string[]): SortStage\n /**\n * Adds a sort stage that sorts the aggregation results by the specified fields in descending order.\n *\n * The `descending()` method refines the aggregation to sort results in descending order of the specified fields. If you specify more than one field, `descending()` sorts the results in descending order by each field in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes before `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a field contains a number as a String, that value is sorted alphabetically and not numerically. Items that do not have a value for the specified sort field are ranked lowest.\n *\n * @public\n * @documentationMaturity preview\n * @param fields - Fields to sort by.\n * @returns SortStage object.\n */\n descending(...fields: string[]): SortStage\n}\n\nexport class SortStageImpl implements SortStage {\n private sortFields: apiTypes.Sorting[] = []\n\n ascending(...fields: string[]): SortStage {\n fields.forEach((field) => {\n this.sortFields.push({ fieldName: field, order: apiTypes.SortOrder.ASC })\n })\n return this\n }\n\n descending(...fields: string[]): SortStage {\n fields.forEach((field) => {\n this.sortFields.push({ fieldName: field, order: apiTypes.SortOrder.DESC })\n })\n return this\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return { sort: { values: this.sortFields } }\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAuD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAEvD;AACA;AACA;;AA0CO,MAAMkB,aAAa,CAAsB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAX,OAAA,sBACL,EAAE;EAAA;EAE3CY,SAASA,CAAC,GAAGC,MAAgB,EAAa;IACxCA,MAAM,CAACC,OAAO,CAAEC,KAAK,IAAK;MACxB,IAAI,CAACC,UAAU,CAACC,IAAI,CAAC;QAAEC,SAAS,EAAEH,KAAK;QAAEI,KAAK,EAAEhC,QAAQ,CAACiC,SAAS,CAACC;MAAI,CAAC,CAAC;IAC3E,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEAC,UAAUA,CAAC,GAAGT,MAAgB,EAAa;IACzCA,MAAM,CAACC,OAAO,CAAEC,KAAK,IAAK;MACxB,IAAI,CAACC,UAAU,CAACC,IAAI,CAAC;QAAEC,SAAS,EAAEH,KAAK;QAAEI,KAAK,EAAEhC,QAAQ,CAACiC,SAAS,CAACG;MAAK,CAAC,CAAC;IAC5E,CAAC,CAAC;IACF,OAAO,IAAI;EACb;;EAEA;EACAC,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,IAAI,EAAE;QAAEC,MAAM,EAAE,IAAI,CAACV;MAAW;IAAE,CAAC;EAC9C;AACF;AAACW,OAAA,CAAAlB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_FilterStage","require","_ProjectStage","_GroupStage","_UnwindStage","_SortStage","_LimitStage","_SkipStage","_ObjectToArrayStage","stages","exports","filter","FilterStageImpl","project","ProjectStageImpl","group","GroupStageImpl","unwind","arrayFieldName","UnwindStageImpl","sort","SortStageImpl","limit","count","LimitStageImpl","skip","SkipStageImpl","objectToArray","objectFieldName","destinationFieldName","ObjectToArrayStageImpl"],"sources":["../../../../src/api/stages/stages.ts"],"sourcesContent":["import { FilterStage, FilterStageImpl } from './FilterStage'\nimport { ProjectStage, ProjectStageImpl } from './ProjectStage'\nimport { GroupStage, GroupStageImpl } from './GroupStage'\nimport { UnwindStage, UnwindStageImpl } from './UnwindStage'\nimport { SortStage, SortStageImpl } from './SortStage'\nimport { LimitStage, LimitStageImpl } from './LimitStage'\nimport { SkipStage, SkipStageImpl } from './SkipStage'\nimport * as apiTypes from '../../types/data-item-types'\nimport {\n ObjectToArrayStage,\n ObjectToArrayStageImpl,\n} from './ObjectToArrayStage'\n\nexport const stages: WixDataAggregatePipelineStages = {\n filter: () => new FilterStageImpl(),\n project: () => new ProjectStageImpl(),\n group: () => new GroupStageImpl(),\n unwind: (arrayFieldName: string) => new UnwindStageImpl(arrayFieldName),\n sort: () => new SortStageImpl(),\n limit: (count: number) => new LimitStageImpl(count),\n skip: (count: number) => new SkipStageImpl(count),\n objectToArray: (objectFieldName: string, destinationFieldName: string) =>\n new ObjectToArrayStageImpl(objectFieldName, destinationFieldName),\n}\n\n/**\n * @builder\n */\nexport interface WixDataAggregatePipelineStages {\n /**\n * Adds a filter stage to the aggregation pipeline.\n *\n * The `filter()` method adds a pipeline stage that only processes items that match the specified criteria. You can configure the filter by chaining one or more [`
|
|
1
|
+
{"version":3,"names":["_FilterStage","require","_ProjectStage","_GroupStage","_UnwindStage","_SortStage","_LimitStage","_SkipStage","_ObjectToArrayStage","stages","exports","filter","FilterStageImpl","project","ProjectStageImpl","group","GroupStageImpl","unwind","arrayFieldName","UnwindStageImpl","sort","SortStageImpl","limit","count","LimitStageImpl","skip","SkipStageImpl","objectToArray","objectFieldName","destinationFieldName","ObjectToArrayStageImpl"],"sources":["../../../../src/api/stages/stages.ts"],"sourcesContent":["import { FilterStage, FilterStageImpl } from './FilterStage'\nimport { ProjectStage, ProjectStageImpl } from './ProjectStage'\nimport { GroupStage, GroupStageImpl } from './GroupStage'\nimport { UnwindStage, UnwindStageImpl } from './UnwindStage'\nimport { SortStage, SortStageImpl } from './SortStage'\nimport { LimitStage, LimitStageImpl } from './LimitStage'\nimport { SkipStage, SkipStageImpl } from './SkipStage'\nimport * as apiTypes from '../../types/data-item-types'\nimport {\n ObjectToArrayStage,\n ObjectToArrayStageImpl,\n} from './ObjectToArrayStage'\n\nexport const stages: WixDataAggregatePipelineStages = {\n filter: () => new FilterStageImpl(),\n project: () => new ProjectStageImpl(),\n group: () => new GroupStageImpl(),\n unwind: (arrayFieldName: string) => new UnwindStageImpl(arrayFieldName),\n sort: () => new SortStageImpl(),\n limit: (count: number) => new LimitStageImpl(count),\n skip: (count: number) => new SkipStageImpl(count),\n objectToArray: (objectFieldName: string, destinationFieldName: string) =>\n new ObjectToArrayStageImpl(objectFieldName, destinationFieldName),\n}\n\n/**\n * @builder\n */\nexport interface WixDataAggregatePipelineStages {\n /**\n * Adds a filter stage to the aggregation pipeline.\n *\n * The `filter()` method adds a pipeline stage that only processes items that match the specified criteria. You can configure the filter by chaining one or more [`FilterStage`](https://dev.wix.com/docs/sdk/backend-modules/data/items/filter-stage/introduction) methods.\n *\n * @public\n * @documentationMaturity preview\n * @returns FilterStage object.\n */\n filter(): FilterStage\n\n /**\n * Adds a project stage to the aggregation pipeline.\n *\n * The `project()` method adds a pipeline stage that transforms items by including, excluding, or reshaping fields. You can configure the projection by chaining one or more [`ProjectStage`](https://dev.wix.com/docs/sdk/backend-modules/data/items/project-stage/introduction) methods.\n *\n * @public\n * @documentationMaturity preview\n * @returns ProjectStage object.\n */\n project(): ProjectStage\n\n /**\n * Adds a group stage to the aggregation pipeline.\n *\n * The `group()` method adds a pipeline stage that groups items by specified fields and calculates aggregate values. You can configure the grouping by chaining one or more [`GroupStage`](https://dev.wix.com/docs/sdk/backend-modules/data/items/group-stage/introduction) methods.\n *\n * @public\n * @documentationMaturity preview\n * @returns GroupStage object.\n */\n group(): GroupStage\n\n /**\n * Adds an unwind stage to the aggregation pipeline.\n *\n * The `unwind()` method adds a pipeline stage that unwinds an array field by creating a new result item for each array element. Each result contains the array element and all other fields from the original item.\n *\n * @public\n * @documentationMaturity preview\n * @param arrayFieldName - Array field to unwind. Use dot notation to specify a nested array. For example, `user.products` or `product.colors`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns UnwindStage object.\n */\n unwind(arrayFieldName: string): UnwindStage\n\n /**\n * Adds a sort stage to the aggregation pipeline.\n *\n * The `sort()` method adds a pipeline stage that sorts items by specified fields. You can configure the sorting by chaining one or more [`SortStage`](https://dev.wix.com/docs/sdk/backend-modules/data/items/sort-stage/introduction) methods.\n *\n * @public\n * @documentationMaturity preview\n * @returns SortStage object.\n */\n sort(): SortStage\n\n /**\n * Adds a limit stage to the aggregation pipeline.\n *\n * The `limit()` method adds a pipeline stage that limits the number of results to the specified count.\n *\n * @public\n * @documentationMaturity preview\n * @param count - Maximum number of results.\n * @returns LimitStage object.\n */\n limit(count: number): LimitStage\n\n /**\n * Adds a skip stage to the aggregation pipeline.\n *\n * The `skip()` method adds a pipeline stage that skips the specified number of items from the beginning of the result set.\n *\n * @public\n * @documentationMaturity preview\n * @param count - Number of items to skip.\n * @requiredField count\n * @returns SkipStage object.\n */\n skip(count: number): SkipStage\n\n /**\n * Adds an objectToArray stage to the aggregation pipeline.\n *\n * The `objectToArray()` method adds a pipeline stage that converts an object into an array of objects with key-value pairs. Each property of the object becomes an element in the new array. Each element contains that property's key and value, as well as all other properties from the original object.\n *\n * For example, with a destination name of `variantInventory`, the object `{ \"red\": 10, \"blue\": 5, \"green\": 3 }` is transformed into the following array:\n *\n * `\"variantInventory\": [\n * { \"k\": \"red\", \"v\": 10 },\n * { \"k\": \"blue\", \"v\": 5 },\n * { \"k\": \"green\", \"v\": 3 }\n * ]`.\n *\n * @public\n * @documentationMaturity preview\n * @param objectFieldName - Field to convert to an array. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @param destinationFieldName - Field to create in the result item.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ObjectToArrayStage object.\n */\n objectToArray(\n objectFieldName: string,\n destinationFieldName: string\n ): ObjectToArrayStage\n}\n\nexport interface PipelineStage {\n /**\n * @private\n */\n build(): apiTypes.Stage\n}\n"],"mappings":";;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAEA,IAAAO,mBAAA,GAAAP,OAAA;AAKO,MAAMQ,MAAsC,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpDE,MAAM,EAAEA,CAAA,KAAM,IAAIC,4BAAe,CAAC,CAAC;EACnCC,OAAO,EAAEA,CAAA,KAAM,IAAIC,8BAAgB,CAAC,CAAC;EACrCC,KAAK,EAAEA,CAAA,KAAM,IAAIC,0BAAc,CAAC,CAAC;EACjCC,MAAM,EAAGC,cAAsB,IAAK,IAAIC,4BAAe,CAACD,cAAc,CAAC;EACvEE,IAAI,EAAEA,CAAA,KAAM,IAAIC,wBAAa,CAAC,CAAC;EAC/BC,KAAK,EAAGC,KAAa,IAAK,IAAIC,0BAAc,CAACD,KAAK,CAAC;EACnDE,IAAI,EAAGF,KAAa,IAAK,IAAIG,wBAAa,CAACH,KAAK,CAAC;EACjDI,aAAa,EAAEA,CAACC,eAAuB,EAAEC,oBAA4B,KACnE,IAAIC,0CAAsB,CAACF,eAAe,EAAEC,oBAAoB;AACpE,CAAC;;AAED;AACA;AACA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/api/types.ts"],"sourcesContent":["export interface BaseOptions {\n /**\n * Prevents hooks from running for the operation. Can only be used in the [backend code of a Wix site](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/about-the-site-backend).\n *\n * Default: `false`.\n */\n suppressHooks?: boolean\n\n /**\n * When `true`, operations include draft items. Read operations include draft items in their response, and write operations modify draft items.\n *\n * Default: `false`.\n */\n showDrafts?: boolean\n}\n\nexport interface WithAppOptions {\n /**\n * Options for [querying Wix app collections](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-app-collections/querying-wix-app-collections).\n */\n appOptions?: Record<string, any>\n}\n\nexport interface WixDataOptions extends BaseOptions, WithAppOptions {}\n\nexport interface WixDataReadOptions extends WixDataOptions, WithAppOptions {\n /**\n * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.\n * If provided, the result text is returned in the specified language. If not provided, the result text is not translated.\n *\n * > **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).\n *\n */\n language?: string\n\n /**\n * When `true`, reads data from the primary database instance. This decreases performance but ensures data retrieved is\n * up-to-date even immediately after an update. Learn more about [Wix Data and
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/api/types.ts"],"sourcesContent":["export interface BaseOptions {\n /**\n * Prevents hooks from running for the operation. Can only be used in the [backend code of a Wix site](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/about-the-site-backend).\n *\n * Default: `false`.\n */\n suppressHooks?: boolean\n\n /**\n * When `true`, operations include draft items. Read operations include draft items in their response, and write operations modify draft items.\n *\n * Default: `false`.\n */\n showDrafts?: boolean\n}\n\nexport interface WithAppOptions {\n /**\n * Options for [querying Wix app collections](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-app-collections/querying-wix-app-collections).\n */\n appOptions?: Record<string, any>\n}\n\nexport interface WixDataOptions extends BaseOptions, WithAppOptions {}\n\nexport interface WixDataReadOptions extends WixDataOptions, WithAppOptions {\n /**\n * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.\n * If provided, the result text is returned in the specified language. If not provided, the result text is not translated.\n *\n * > **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).\n *\n */\n language?: string\n\n /**\n * When `true`, reads data from the primary database instance. This decreases performance but ensures data retrieved is\n * up-to-date even immediately after an update. Learn more about [Wix Data and eventual consistency](https://dev.wix.com/docs/sdk/backend-modules/data/eventual-consistency).\n */\n consistentRead?: boolean\n}\n\nexport interface WixDataReadWithProjectionOptions\n extends WixDataReadOptions,\n ProjectionOptions {}\n\nexport interface WixDataUpdateOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n}\n\nexport interface WixDataPatchOptions extends BaseOptions {}\n\nexport interface WixDataAggregateOptions extends WixDataQueryOptions {}\n\nexport interface WixDataQueryOptions extends WixDataReadOptions {\n /**\n * When `true`, the query results include a `totalCount` and `totalPages` properties containing the totals of items\n * matching query. Requesting total count slows down the query.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n}\n\nexport interface WixDataQueryReferencedOptions\n extends WixDataQueryOptions,\n ProjectionOptions {\n /**\n * Order of the returned referenced items. Sorted by the date each item was referenced.\n *\n * Default: `asc`\n */\n order?: 'asc' | 'desc'\n\n /**\n * Number of items to load.\n *\n * Default: `50`\n */\n skip?: number\n\n /**\n * Number of items to skip in the current sort order.\n *\n * Default: `0`\n */\n limit?: number\n}\n\ninterface ProjectionOptions {\n /**\n * Lists of fields to return in a result.\n */\n fields?: string[]\n}\n\nexport interface WixDataItem {\n /**\n * Data item ID.\n */\n _id: string\n\n /**\n * Date and time the item was added to the collection.\n * @readonly\n */\n _createdDate?: Date\n\n /**\n * Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have\n * the same value.\n * @readonly\n */\n _updatedDate?: Date\n\n /**\n * ID of the user who created the item. Can be modified with site owner permissions.\n */\n _owner?: string\n\n /**\n * Data item contents.\n */\n [key: string]: any\n}\n\nexport type WixDataItemOrId = WixDataItem | string\nexport type Comparable = string | number | Date\n\nexport interface WixDataReference {\n relationshipName: string\n left: WixDataItemOrId\n right: WixDataItemOrId\n}\n\nexport interface Provider<T> {\n get(): T | Promise<T>\n}\n\nexport interface WixDataBulkError extends Error {\n /**\n * Description of the error.\n */\n message: string\n\n /**\n * Error code.\n */\n code: string\n\n /**\n * Index of the item within the request array. Allows for correlation between request and response items.\n */\n originalIndex: number\n\n /**\n * Failed item (or ID in case of `bulkRemove()`).\n */\n item: WixDataItem | string\n}\n\nexport interface WixDataBulkResult {\n /**\n * Number of inserted items.\n */\n inserted: number\n\n /**\n * Number of updated items.\n */\n updated: number\n\n /**\n * Number of removed items.\n */\n removed: number\n\n /**\n * Number of skipped items.\n */\n skipped: number\n\n /**\n * List of errors.\n */\n errors: WixDataBulkError[]\n\n /**\n * List of IDs of inserted items.\n */\n insertedItemIds: string[]\n\n /**\n * List of IDs of updated items.\n */\n updatedItemIds: string[]\n\n /**\n * List of IDs of removed items.\n */\n removedItemIds: string[]\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/filter/WithFilter.ts"],"sourcesContent":["type Comparable = string | number | Date\n\n/**\n * Type that allow filter construction.\n * All construction methods return copy of self\n */\nexport default interface WithFilter<Self extends WithFilter<Self>> {\n /**\n * Filter JSON, possibly invalid\n * @internal\n */\n readonly filterTree: Record<string, any>\n\n /**\n * Validation errors, if empty filterTree is valid\n * @internal\n */\n readonly invalidArguments: string[]\n\n /**\n * Refines a query or filter to match items whose specified property value equals the specified value.\n *\n * The `eq()` function refines this filter to only\n * match items where the value of the specified property equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type Array, `eq()` includes the item\n * as long as at least one Array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n eq(field: string, value: any): Self\n\n /**\n * Refines a query or filter to match items whose specified property value does not equal the specified value.\n *\n * The `ne()` function refines this filter to only\n * match items where the value of the specified property does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the `field` property is an Array, `ne()` includes items\n * in which none of the elements of the Array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n ne(field: string, value: any): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is greater than or equal to the specified\n * value.\n *\n * The `ge()` function refines this filter to only\n * match items where the value of the specified property is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n ge(field: string, value: Comparable): Self\n\n /**\n * Alias for `ge()`\n * @internal\n */\n gte(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is greater than the specified value.\n *\n * The `gt()` function refines this filter to only match\n * items where the value of the specified property is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n gt(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is less than or equal to the specified\n * value.\n *\n * The `le()` function refines this filter to only match\n * items where the value of the specified property is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n le(field: string, value: Comparable): Self\n\n /**\n * Alias for `le()`\n * @internal\n */\n lte(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is less than the specified value.\n *\n * The `lt()` function refines this filter to only match\n * items where the value of the specified property is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n lt(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property has any value.\n *\n * The `isNotEmpty()` function refines this filter to only match items where the\n * value of the specified property is not `null` or `undefined`.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - The property in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined query.\n */\n isNotEmpty(field: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property does not exist or does not have any value.\n *\n * The `isEmpty()` function refines this filter to only match items where the\n * value of the specified property is `null` or `undefined` or the property does\n * not exist.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - The property in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined query.\n */\n isEmpty(field: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value starts with a specified string.\n *\n * The `startsWith()` function refines this filter to\n * only match items where the value of the specified property starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Property whose value will be compared with the `value` parameter.\n * @requiredField field\n * @param value - String to look for at the beginning of the specified property value.\n * @requiredField value\n * @returns `WixDataQuery` object representing the refined query.\n */\n startsWith(field: string, value: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value ends with a specified string.\n *\n * The `endsWith()` function refines this filter to only\n * match items where the value of the specified property ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Property whose value will be compared with the string.\n * @requiredField field\n * @param value - String to look for at the end of the specified property value.\n * @requiredField value\n * @returns `WixDataQuery` object representing the refined query.\n */\n endsWith(field: string, value: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value contains a specified string.\n *\n * The `contains()` function refines this filter to\n * only match items where the value of the specified property contains the\n * specified `string`. Matching with `contains()` is not case sensitive, so\n * `\"text\"` does contain `\"Tex\"`.\n *\n * You can use `contains()` with a property whose value is a String or a Reference.\n * For properties of type reference it is recommended that you use the [`eq()`](#eq)\n * function instead of `contains()`. With properties that are References, `contains()`\n * matches by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with the string.\n * @requiredField field\n * @param value - The string to look for inside the specified property value.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n contains(field: string, value: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` function refines this filter to\n * only match items where the value of the specified property equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified property contains multiple references, pass item IDs in the\n * `value` property. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param values - The values to match against.\n * @requiredField values\n * @returns An object representing the refined query.\n */\n hasSome(field: string, ...values: Comparable[]): Self\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: Comparable[]): Self\n\n /**\n * Alias for `hasSome()`\n * @internal\n */\n in(field: string, ...values: Comparable[]): Self\n\n /**\n * Alias for `hasSome()`\n * @internal\n */\n in(field: string, values: Comparable[]): Self\n\n /**\n * Refines a query or filter to match items whose specified property values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` function refines this filter to\n * only match items where the value of the specified property equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param values - The values to match against.\n * @requiredField values\n * @returns An object representing the refined query.\n */\n hasAll(field: string, ...values: Comparable[]): Self\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: Comparable[]): Self\n\n /**\n * Exists filter.\n * @returns `current $and (field $exists value)`\n * @internal\n */\n exists(field: string, value: boolean): Self\n\n /**\n * Adds an `or` condition to the query or filter.\n *\n * The `or()` function adds an inclusive `or` condition to this filter. A query or filter\n * with an `or` returns all the items that match the query or filter as defined up to\n * the `or` function, the items that match the query or filter passed to the `or`\n * function, and the items that match both.\n *\n * The collections used by both the initial query and the query passed\n * to the `or` function must be the same.\n *\n * The 'or()' function is designed to work with 2 or more queries or filters.\n * If you use it on its own, it will return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Object representing the refined query.\n */\n or(filter: WithFilter<any>): Self\n\n /**\n * Adds an `and` condition to the query or filter.\n *\n * The `and()` function adds an and condition to this query. A query or filter with an `and` returns all the items\n * that match the query or filter as defined up to the `and` function and also match the query or filter passed to\n * the `and` function.\n *\n * Note that when chaining multiple `WixDataFilter` functions to a query an and condition is assumed. In such cases,\n * you do not need to add a call to the `and()` function. For example, this query returns results where status is\n * active **and** age is greater than 25.\n * ```js\n * wixData.query(\"myCollection\").eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * The `and()` function is needed when performing compound queries. For example, the final query in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n * ```js\n * let statusQuery = wixData\n * .query(\"myCollection\")\n * .eq(\"status\", \"pending\")\n * .or(wixData.query(\"myCollection\").eq(\"status\", \"rejected\"));\n *\n * let ageQuery = wixData\n * .query(\"myCollection\")\n * .lt(\"age\", 25)\n * .or(wixData.query(\"myCollection\").gt(\"age\", 65));\n *\n * let statusAndAgeQuery = statusQuery.and(ageQuery);\n * ```\n *\n * The collections referenced by both the initial query and the query passed to the `and` function must be the same.\n *\n * The `and()` function is designed to work with 2 or more queries or filters. If you use it on its own, it will\n * return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - A filter to add to the initial query as an `and` condition.\n * @requiredField filter\n * @returns An object representing the refined query.\n */\n and(filter: WithFilter<any>): Self\n\n /**\n * Adds a `not` condition to the query or filter.\n *\n * The `not()` function adds a `not` condition to this filter. A query or filter with a `not`\n * returns all the items that match the query or filter as defined up to the `not`\n * function, but don't match the query or filter passed to the `not` function.\n *\n * If the query or filter only contains a `not()` function, it returns all the items\n * that don't match the query defined by the `not` method.\n *\n * The collections referenced by both the initial query and the query passed\n * to the `not` function must be the same.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Object representing the refined query.\n */\n not(filter: WithFilter<any>): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is within a specified range.\n *\n * The `between()` function refines this query to only match items where the value of the specified property is\n * greater than or equal to `rangeStart` and less than `rangeEnd`.\n *\n * It only matches values of the same type. For example, a number value stored as a String type does not match the\n * same number stored as a Number type.\n *\n * If a property contains a number as a String, that value will be compared alphabetically and not numerically. Items\n * that do not have a value for the specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so\n * - `\"A\"` and `\"M\"` are between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with rangeStart and rangeEnd.\n * @requiredField field\n * @param rangeStart - The beginning value of the range to match against.\n * @requiredField rangeStart\n * @param rangeEnd - The ending value of the range to match against.\n * @requiredField rangeEnd\n * @returns An object representing the refined query.\n */\n between<T extends Comparable>(field: string, rangeStart: T, rangeEnd: T): Self\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/filter/WithFilter.ts"],"sourcesContent":["type Comparable = string | number | Date\n\n/**\n * Type that allow filter construction.\n * All construction methods return copy of self\n */\nexport default interface WithFilter<Self extends WithFilter<Self>> {\n /**\n * Filter JSON, possibly invalid\n * @internal\n */\n readonly filterTree: Record<string, any>\n\n /**\n * Validation errors, if empty filterTree is valid\n * @internal\n */\n readonly invalidArguments: string[]\n\n /**\n * Refines a query or filter to match items whose specified property value equals the specified value.\n *\n * The `eq()` function refines this filter to only\n * match items where the value of the specified property equals the specified `value`.\n *\n * The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored\n * as a number does not match the same number stored as a string.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type Array, `eq()` includes the item\n * as long as at least one Array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n eq(field: string, value: any): Self\n\n /**\n * Refines a query or filter to match items whose specified property value does not equal the specified value.\n *\n * The `ne()` function refines this filter to only\n * match items where the value of the specified property does not equal the specified `value`.\n *\n * The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored\n * as a number is considered not equal to the same number stored as a string.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the `field` property is an Array, `ne()` includes items\n * in which none of the elements of the Array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n ne(field: string, value: any): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is greater than or equal to the specified\n * value.\n *\n * The `ge()` function refines this filter to only\n * match items where the value of the specified property is greater than or\n * equal to the specified `value`.\n *\n * The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored\n * as a number does not match the same number stored as a string.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n ge(field: string, value: Comparable): Self\n\n /**\n * Alias for `ge()`\n * @internal\n */\n gte(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is greater than the specified value.\n *\n * The `gt()` function refines this filter to only match\n * items where the value of the specified property is greater than the specified `value`.\n *\n * The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored\n * as a number does not match the same number stored as a string.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n gt(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is less than or equal to the specified\n * value.\n *\n * The `le()` function refines this filter to only match\n * items where the value of the specified property is less than or equal to the\n * specified `value`.\n *\n * The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored\n * as a number does not match the same number stored as a string.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n le(field: string, value: Comparable): Self\n\n /**\n * Alias for `le()`\n * @internal\n */\n lte(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is less than the specified value.\n *\n * The `lt()` function refines this filter to only match\n * items where the value of the specified property is less than the specified `value`.\n *\n * The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored\n * as a number does not match the same number stored as a string.\n *\n * If a property contains a number as a String, that value will be compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param value - The value to match against.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n lt(field: string, value: Comparable): Self\n\n /**\n * Refines a query or filter to match items whose specified property has any value.\n *\n * The `isNotEmpty()` function refines this filter to only match items where the\n * value of the specified property is not `null` or `undefined`.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - The property in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined query.\n */\n isNotEmpty(field: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property does not exist or does not have any value.\n *\n * The `isEmpty()` function refines this filter to only match items where the\n * value of the specified property is `null` or `undefined` or the property does\n * not exist.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - The property in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined query.\n */\n isEmpty(field: string): Self\n\n /**\n * Refines a query or filter to match items where the value of the specified field starts with a specified value.\n *\n * The `startsWith()` function refines this filter to only match items where the value of the specified field starts with the specified value. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` is considered to start with `\"tex\"`.\n *\n * You can only use `startsWith()` with a [field of type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data) string or reference. When matching a field of type reference, `startsWith()` matches by the ID of the referenced item as a string.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value will be compared with the specified value.\n * @requiredField field\n * @param value - String to look for at the beginning of the specified field value.\n * @requiredField value\n * @returns `WixDataQuery` object representing the refined query.\n */\n startsWith(field: string, value: string): Self\n\n /**\n * Refines a query or filter to match items where the value of the specified field ends with a specified value.\n *\n * The `endsWith()` function refines this filter to only match items where the value of the specified field ends with the specified value. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` is considered to end with `\"ext\"`.\n *\n * You can only use `endsWith()` with a [field of type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data) string or reference. When matching a field of type reference, `endsWith()` matches by the ID of the referenced item as a string.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value will be compared with the specified value.\n * @requiredField field\n * @param value - String to look for at the end of the specified property value.\n * @requiredField value\n * @returns `WixDataQuery` object representing the refined query.\n */\n endsWith(field: string, value: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value contains a specified value.\n *\n * The `contains()` method refines the filter to only match items where the value of the specified property contains the specified value. Matching with `contains()` is not case sensitive, so `\"text\"` is considered to contain `\"Tex\"`.\n *\n * You can use `contains()` with a [field of type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data) string or reference.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with the string.\n * @requiredField field\n * @param value - The string to look for inside the specified property value.\n * @requiredField value\n * @returns An object representing the refined query.\n */\n contains(field: string, value: string): Self\n\n /**\n * Refines a query or filter to match items whose specified property value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` function refines this filter to\n * only match items where the value of the specified property equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified property contains multiple references, pass item IDs in the\n * `value` property. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param values - The values to match against.\n * @requiredField values\n * @returns An object representing the refined query.\n */\n hasSome(field: string, ...values: Comparable[]): Self\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: Comparable[]): Self\n\n /**\n * Alias for `hasSome()`\n * @internal\n */\n in(field: string, ...values: Comparable[]): Self\n\n /**\n * Alias for `hasSome()`\n * @internal\n */\n in(field: string, values: Comparable[]): Self\n\n /**\n * Refines a query or filter to match items whose specified property values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` function refines this filter to\n * only match items where the value of the specified property equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with `value`.\n * @requiredField field\n * @param values - The values to match against.\n * @requiredField values\n * @returns An object representing the refined query.\n */\n hasAll(field: string, ...values: Comparable[]): Self\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: Comparable[]): Self\n\n /**\n * Exists filter.\n * @returns `current $and (field $exists value)`\n * @internal\n */\n exists(field: string, value: boolean): Self\n\n /**\n * Adds an `or` condition to the query or filter.\n *\n * The `or()` function adds an inclusive `or` condition to this filter. A query or filter\n * with an `or` returns all the items that match the query or filter as defined up to\n * the `or` function, the items that match the query or filter passed to the `or`\n * function, and the items that match both.\n *\n * The collections used by both the initial query and the query passed\n * to the `or` function must be the same.\n *\n * The 'or()' function is designed to work with 2 or more queries or filters.\n * If you use it on its own, it will return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Object representing the refined query.\n */\n or(filter: WithFilter<any>): Self\n\n /**\n * Adds an `and` condition to the query or filter.\n *\n * The `and()` function adds an and condition to this query. A query or filter with an `and` returns all the items\n * that match the query or filter as defined up to the `and` function and also match the query or filter passed to\n * the `and` function.\n *\n * Note that when chaining multiple `WixDataFilter` functions to a query an and condition is assumed. In such cases,\n * you do not need to add a call to the `and()` function. For example, this query returns results where status is\n * active **and** age is greater than 25.\n * ```js\n * wixData.query(\"myCollection\").eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * The `and()` function is needed when performing compound queries. For example, the final query in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n * ```js\n * let statusQuery = wixData\n * .query(\"myCollection\")\n * .eq(\"status\", \"pending\")\n * .or(wixData.query(\"myCollection\").eq(\"status\", \"rejected\"));\n *\n * let ageQuery = wixData\n * .query(\"myCollection\")\n * .lt(\"age\", 25)\n * .or(wixData.query(\"myCollection\").gt(\"age\", 65));\n *\n * let statusAndAgeQuery = statusQuery.and(ageQuery);\n * ```\n *\n * The collections referenced by both the initial query and the query passed to the `and` function must be the same.\n *\n * The `and()` function is designed to work with 2 or more queries or filters. If you use it on its own, it will\n * return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - A filter to add to the initial query as an `and` condition.\n * @requiredField filter\n * @returns An object representing the refined query.\n */\n and(filter: WithFilter<any>): Self\n\n /**\n * Adds a `not` condition to the query or filter.\n *\n * The `not()` function adds a `not` condition to this filter. A query or filter with a `not`\n * returns all the items that match the query or filter as defined up to the `not`\n * function, but don't match the query or filter passed to the `not` function.\n *\n * If the query or filter only contains a `not()` function, it returns all the items\n * that don't match the query defined by the `not` method.\n *\n * The collections referenced by both the initial query and the query passed\n * to the `not` function must be the same.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Object representing the refined query.\n */\n not(filter: WithFilter<any>): Self\n\n /**\n * Refines a query or filter to match items whose specified property value is within a specified range.\n *\n * The `between()` function refines this query to only match items where the value of the specified property is\n * greater than or equal to `rangeStart` and less than `rangeEnd`.\n *\n * The method only matches values of the same [data type](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-types-in-wix-data). For example, a number value stored as a number does not match the same number stored as a string.\n *\n * If a property contains a number as a string, that value will be compared alphabetically and not numerically. Items that do not have a value for the specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so\n * - `\"A\"` and `\"M\"` are between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n * @public\n * @documentationMaturity preview\n * @param field - The property whose value will be compared with rangeStart and rangeEnd.\n * @requiredField field\n * @param rangeStart - The beginning value of the range to match against.\n * @requiredField rangeStart\n * @param rangeEnd - The ending value of the range to match against.\n * @requiredField rangeEnd\n * @returns An object representing the refined query.\n */\n between<T extends Comparable>(field: string, rangeStart: T, rangeEnd: T): Self\n}\n"],"mappings":"","ignoreList":[]}
|