@wix/wix-data-items-common 1.0.199 → 1.0.200

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.
Files changed (44) hide show
  1. package/dist/cjs/api/expressions/Expression.js +7 -7
  2. package/dist/cjs/api/expressions/Expression.js.map +1 -1
  3. package/dist/cjs/api/expressions/expressions.js +2 -2
  4. package/dist/cjs/api/expressions/expressions.js.map +1 -1
  5. package/dist/cjs/api/index.js +20 -1
  6. package/dist/cjs/api/index.js.map +1 -1
  7. package/dist/cjs/api/stages/GroupStage.js +2 -2
  8. package/dist/cjs/api/stages/GroupStage.js.map +1 -1
  9. package/dist/cjs/api/stages/ObjectToArrayStage.js +3 -3
  10. package/dist/cjs/api/stages/ObjectToArrayStage.js.map +1 -1
  11. package/dist/cjs/api/stages/ProjectStage.js +8 -8
  12. package/dist/cjs/api/stages/ProjectStage.js.map +1 -1
  13. package/dist/cjs/api/stages/stages.js +1 -1
  14. package/dist/cjs/api/stages/stages.js.map +1 -1
  15. package/dist/cjs/types/data-item-types.js +3 -3
  16. package/dist/cjs/types/data-item-types.js.map +1 -1
  17. package/dist/esm/api/expressions/Expression.js +4 -4
  18. package/dist/esm/api/expressions/Expression.js.map +1 -1
  19. package/dist/esm/api/expressions/expressions.js +3 -3
  20. package/dist/esm/api/expressions/expressions.js.map +1 -1
  21. package/dist/esm/api/stages/GroupStage.js +3 -3
  22. package/dist/esm/api/stages/GroupStage.js.map +1 -1
  23. package/dist/esm/api/stages/ObjectToArrayStage.js +3 -3
  24. package/dist/esm/api/stages/ObjectToArrayStage.js.map +1 -1
  25. package/dist/esm/api/stages/ProjectStage.js +6 -6
  26. package/dist/esm/api/stages/ProjectStage.js.map +1 -1
  27. package/dist/esm/api/stages/stages.js +1 -1
  28. package/dist/esm/api/stages/stages.js.map +1 -1
  29. package/dist/types/api/expressions/Expression.d.ts +4 -4
  30. package/dist/types/api/expressions/Expression.d.ts.map +1 -1
  31. package/dist/types/api/expressions/expressions.d.ts +3 -3
  32. package/dist/types/api/expressions/expressions.d.ts.map +1 -1
  33. package/dist/types/api/index.d.ts +1 -0
  34. package/dist/types/api/index.d.ts.map +1 -1
  35. package/dist/types/api/stages/GroupStage.d.ts.map +1 -1
  36. package/dist/types/api/stages/ObjectToArrayStage.d.ts +2 -2
  37. package/dist/types/api/stages/ObjectToArrayStage.d.ts.map +1 -1
  38. package/dist/types/api/stages/ProjectStage.d.ts +4 -4
  39. package/dist/types/api/stages/ProjectStage.d.ts.map +1 -1
  40. package/dist/types/api/stages/stages.d.ts +1 -1
  41. package/dist/types/api/stages/stages.d.ts.map +1 -1
  42. package/dist/types/types/data-item-types.d.ts +316 -158
  43. package/dist/types/types/data-item-types.d.ts.map +1 -1
  44. package/package.json +2 -2
@@ -1590,475 +1590,633 @@ export interface SearchDataItemsResponse {
1590
1590
  pagingMetadata?: PagingMetadataV2;
1591
1591
  }
1592
1592
  export interface AggregatePipelineDataItemsRequest extends AggregatePipelineDataItemsRequestPagingMethodOneOf {
1593
- /** Paging options to limit and skip the number of items. */
1593
+ /**
1594
+ * Paging options to limit and skip the number of results.
1595
+ *
1596
+ * Learn more about [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
1597
+ */
1594
1598
  paging?: Paging;
1595
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
1599
+ /**
1600
+ * Cursor token referring to a page of results.
1601
+ *
1602
+ * The token isn't used in the first request. Subsequent requests use the cursor token and not `filter` or `sort`.
1603
+ */
1596
1604
  cursorPaging?: CursorPaging;
1597
1605
  /**
1598
- * Environment: LIVE or SANDBOX
1606
+ * Environment: `LIVE` or `SANDBOX`.
1599
1607
  * @internal
1600
1608
  */
1601
1609
  environment?: Environment;
1602
1610
  /**
1603
- * ID of the collection on which to run the aggregation.
1611
+ * ID of the collection to run the aggregation pipeline on.
1604
1612
  * @maxLength 256
1605
1613
  */
1606
1614
  dataCollectionId: string;
1607
1615
  /**
1608
- * Aggregation operations applied (in order) to the data.
1616
+ * Sequence of aggregation operations to apply to the data.
1617
+ *
1618
+ * Stages are processed in order, with each stage operating on the output of the previous stage.
1609
1619
  * @maxSize 100
1610
1620
  */
1611
1621
  stages?: Stage[];
1612
1622
  /**
1613
- * Whether to return the total count in the response for a query with offset paging.
1614
- * When `true`, the `pagingMetadata` object in the response contains a `total` field.
1623
+ * Whether to return the total result count when running a query with offset paging.
1624
+ *
1625
+ * When `true`, the `pagingMetadata` property in the response contains a `total` field.
1626
+ *
1627
+ * Learn more about [offset paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging#paging).
1615
1628
  *
1616
1629
  * Default: `false`
1617
1630
  */
1618
1631
  returnTotalCount?: boolean;
1619
1632
  /**
1620
- * Grid app id. Optional in Live segment.
1633
+ * Grid app ID. Optional in Live segment.
1621
1634
  * @internal
1622
1635
  * @format GUID
1623
1636
  */
1624
1637
  appId?: string | null;
1625
1638
  /**
1626
- * Whether to retrieve data from the primary database instance.
1639
+ * Whether to read from the primary database for the most current data.
1640
+ *
1627
1641
  * This decreases performance but ensures data retrieved is up to date even immediately after an update.
1642
+ *
1628
1643
  * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
1629
1644
  *
1630
1645
  * Default: `false`
1631
1646
  */
1632
1647
  consistentRead?: boolean;
1633
1648
  /**
1634
- * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
1635
- * If provided, the result text is returned in the specified language.
1636
- * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
1649
+ * Language to run the aggregation on, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.
1637
1650
  *
1638
- * If not provided, result text is not translated.
1651
+ * When provided, the aggregation runs on items in the specified language. When not provided, the aggregation runs on items in the default language.
1652
+ *
1653
+ * > **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
1654
+ *
1655
+ * Learn more about [Using Wix Multilingual to Translate CMS Content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content).
1639
1656
  * @format LANGUAGE_TAG
1640
1657
  */
1641
1658
  language?: string | null;
1642
1659
  /**
1643
1660
  * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.
1644
1661
  *
1645
- * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:
1646
- * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.
1647
- * - `includeVariants`: Whether to include product variants in the query. Default: `false`.
1662
+ * Learn more about [querying Wix app collections](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-app-collections/querying-wix-app-collections).
1648
1663
  */
1649
1664
  appOptions?: Record<string, any> | null;
1650
1665
  /**
1651
1666
  * Options for the Publish plugin.
1652
- * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.
1667
+ *
1668
+ * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items aren't.
1653
1669
  */
1654
1670
  publishPluginOptions?: DataPublishPluginOptions;
1655
1671
  }
1656
1672
  /** @oneof */
1657
1673
  export interface AggregatePipelineDataItemsRequestPagingMethodOneOf {
1658
- /** Paging options to limit and skip the number of items. */
1674
+ /**
1675
+ * Paging options to limit and skip the number of results.
1676
+ *
1677
+ * Learn more about [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
1678
+ */
1659
1679
  paging?: Paging;
1660
- /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
1680
+ /**
1681
+ * Cursor token referring to a page of results.
1682
+ *
1683
+ * The token isn't used in the first request. Subsequent requests use the cursor token and not `filter` or `sort`.
1684
+ */
1661
1685
  cursorPaging?: CursorPaging;
1662
1686
  }
1663
1687
  export interface Expression extends ExpressionValueOneOf {
1664
1688
  /**
1665
- * Field path to the value of field in the document.
1689
+ * Path to the field that contains the value to use in the expression.
1690
+ *
1691
+ * Use dot notation to specify nested fields, such as `user.name` or `product.price`.
1666
1692
  * @maxLength 1000
1667
1693
  */
1668
1694
  fieldPath?: string;
1669
1695
  /**
1670
- * String constant value.
1696
+ * Text value.
1671
1697
  * @maxLength 1000
1672
1698
  */
1673
- stringValue?: string;
1674
- /** Numeric constant value. */
1675
- numericValue?: number;
1676
- /** Add expression */
1699
+ text?: string;
1700
+ /** Numeric value. */
1701
+ numeric?: number;
1702
+ /** Adds the specified expressions together. */
1677
1703
  add?: AddOperation;
1678
- /** Sum expression */
1704
+ /** Calculates the total sum of multiple expressions. */
1679
1705
  sum?: SumOperation;
1680
- /** Subtract expression */
1706
+ /** Subtracts 1 expression from another. */
1681
1707
  subtract?: SubtractOperation;
1682
- /** Multiply expression */
1708
+ /** Multiplies multiple expressions together. */
1683
1709
  multiply?: MultiplyOperation;
1684
- /** Divide expression */
1710
+ /** Divides 1 expression by another. */
1685
1711
  divide?: DivideOperation;
1686
- /** Abs expression */
1712
+ /** Finds the absolute value of an expression. */
1687
1713
  abs?: AbsOperation;
1688
- /** Mod expression */
1714
+ /** Finds the remainder when dividing 1 expression by another. */
1689
1715
  mod?: ModOperation;
1690
- /** Floor expression */
1716
+ /** Rounds an expression down to the nearest whole number. */
1691
1717
  floor?: FloorOperation;
1692
- /** Ceil expression */
1718
+ /** Rounds an expression up to the nearest whole number. */
1693
1719
  ceil?: CeilOperation;
1694
- /** Concat expression */
1720
+ /** Joins multiple expressions together to create a new string. */
1695
1721
  concat?: ConcatOperation;
1696
- /** Stringify expression */
1722
+ /** Converts an expression into a string. */
1697
1723
  stringify?: StringifyOperation;
1698
- /** ToLower expression */
1724
+ /** Converts an expression into lowercase. */
1699
1725
  toLower?: ToLowerOperation;
1700
- /** ToUpper expression */
1726
+ /** Converts an expression into uppercase. */
1701
1727
  toUpper?: ToUpperOperation;
1702
- /** Substring expression */
1728
+ /** Extracts a portion of a string expression. */
1703
1729
  substring?: SubstringOperation;
1704
- /** Length expression */
1730
+ /** Finds the length of a string expression. */
1705
1731
  length?: LengthOperation;
1706
1732
  }
1707
1733
  /** @oneof */
1708
1734
  export interface ExpressionValueOneOf {
1709
1735
  /**
1710
- * Field path to the value of field in the document.
1736
+ * Path to the field that contains the value to use in the expression.
1737
+ *
1738
+ * Use dot notation to specify nested fields, such as `user.name` or `product.price`.
1711
1739
  * @maxLength 1000
1712
1740
  */
1713
1741
  fieldPath?: string;
1714
1742
  /**
1715
- * String constant value.
1743
+ * Text value.
1716
1744
  * @maxLength 1000
1717
1745
  */
1718
- stringValue?: string;
1719
- /** Numeric constant value. */
1720
- numericValue?: number;
1721
- /** Add expression */
1746
+ text?: string;
1747
+ /** Numeric value. */
1748
+ numeric?: number;
1749
+ /** Adds the specified expressions together. */
1722
1750
  add?: AddOperation;
1723
- /** Sum expression */
1751
+ /** Calculates the total sum of multiple expressions. */
1724
1752
  sum?: SumOperation;
1725
- /** Subtract expression */
1753
+ /** Subtracts 1 expression from another. */
1726
1754
  subtract?: SubtractOperation;
1727
- /** Multiply expression */
1755
+ /** Multiplies multiple expressions together. */
1728
1756
  multiply?: MultiplyOperation;
1729
- /** Divide expression */
1757
+ /** Divides 1 expression by another. */
1730
1758
  divide?: DivideOperation;
1731
- /** Abs expression */
1759
+ /** Finds the absolute value of an expression. */
1732
1760
  abs?: AbsOperation;
1733
- /** Mod expression */
1761
+ /** Finds the remainder when dividing 1 expression by another. */
1734
1762
  mod?: ModOperation;
1735
- /** Floor expression */
1763
+ /** Rounds an expression down to the nearest whole number. */
1736
1764
  floor?: FloorOperation;
1737
- /** Ceil expression */
1765
+ /** Rounds an expression up to the nearest whole number. */
1738
1766
  ceil?: CeilOperation;
1739
- /** Concat expression */
1767
+ /** Joins multiple expressions together to create a new string. */
1740
1768
  concat?: ConcatOperation;
1741
- /** Stringify expression */
1769
+ /** Converts an expression into a string. */
1742
1770
  stringify?: StringifyOperation;
1743
- /** ToLower expression */
1771
+ /** Converts an expression into lowercase. */
1744
1772
  toLower?: ToLowerOperation;
1745
- /** ToUpper expression */
1773
+ /** Converts an expression into uppercase. */
1746
1774
  toUpper?: ToUpperOperation;
1747
- /** Substring expression */
1775
+ /** Extracts a portion of a string expression. */
1748
1776
  substring?: SubstringOperation;
1749
- /** Length expression */
1777
+ /** Finds the length of a string expression. */
1750
1778
  length?: LengthOperation;
1751
1779
  }
1752
1780
  export interface AddOperation {
1753
1781
  /**
1754
- * Add expressions.
1782
+ * Expressions to add together.
1783
+ *
1784
+ * All expressions must resolve to numbers.
1755
1785
  * @maxSize 1000
1756
1786
  */
1757
1787
  expressions?: Expression[];
1758
1788
  }
1759
1789
  export interface SumOperation {
1760
1790
  /**
1761
- * Sum expressions.
1791
+ * Expressions to calculate the total sum of.
1792
+ *
1793
+ * All expressions must resolve to numbers.
1762
1794
  * @maxSize 1000
1763
1795
  */
1764
1796
  expressions?: Expression[];
1765
1797
  }
1766
1798
  export interface SubtractOperation {
1767
- /** Expression to subtract from */
1799
+ /**
1800
+ * Expression to subtract `secondExpression` from.
1801
+ *
1802
+ * Expression must resolve to a number.
1803
+ */
1768
1804
  firstExpression?: Expression;
1769
- /** Expression to subtract by */
1805
+ /**
1806
+ * Expression to subtract from `firstExpression`.
1807
+ *
1808
+ * Expression must resolve to a number.
1809
+ */
1770
1810
  secondExpression?: Expression;
1771
1811
  }
1772
1812
  export interface MultiplyOperation {
1773
1813
  /**
1774
- * Multiply expressions.
1814
+ * Expressions to multiply.
1815
+ *
1816
+ * Expressions must resolve to numbers.
1775
1817
  * @maxSize 1000
1776
1818
  */
1777
1819
  expressions?: Expression[];
1778
1820
  }
1779
1821
  export interface DivideOperation {
1780
- /** Expression to divide from */
1822
+ /**
1823
+ * Expression to divide by `secondExpression`.
1824
+ *
1825
+ * Expression must resolve to a number.
1826
+ */
1781
1827
  firstExpression?: Expression;
1782
- /** Expression to divide by */
1828
+ /**
1829
+ * Expression to divide `firstExpression` by.
1830
+ *
1831
+ * Expression must resolve to a non-zero number.
1832
+ */
1783
1833
  secondExpression?: Expression;
1784
1834
  }
1785
1835
  export interface AbsOperation {
1786
- /** Expression to calculate absolute value of. */
1836
+ /**
1837
+ * Expression to find the absolute value of.
1838
+ *
1839
+ * Expression must resolve to a number.
1840
+ */
1787
1841
  expression?: Expression;
1788
1842
  }
1789
1843
  export interface ModOperation {
1790
- /** Expression to calculate modulo from */
1844
+ /**
1845
+ * Expression to divide by `secondExpression`.
1846
+ *
1847
+ * Expression must resolve to a number.
1848
+ */
1791
1849
  firstExpression?: Expression;
1792
- /** Expression to calculate modulo by */
1850
+ /**
1851
+ * Expression to divide `firstExpression` by.
1852
+ *
1853
+ * Expression must resolve to a non-zero number.
1854
+ */
1793
1855
  secondExpression?: Expression;
1794
1856
  }
1795
1857
  export interface FloorOperation {
1796
- /** Expression to calculate floor value of. */
1858
+ /**
1859
+ * Expression to round down to the nearest whole number.
1860
+ *
1861
+ * Expression must resolve to a number.
1862
+ */
1797
1863
  expression?: Expression;
1798
1864
  }
1799
1865
  export interface CeilOperation {
1800
- /** Expression to calculate ceil value of. */
1866
+ /**
1867
+ * Expression to round up to the nearest whole number.
1868
+ *
1869
+ * Expression must resolve to a number.
1870
+ */
1801
1871
  expression?: Expression;
1802
1872
  }
1803
1873
  export interface ConcatOperation {
1804
1874
  /**
1805
- * Expression to concatenate.
1875
+ * Expressions to join together.
1876
+ *
1877
+ * Expressions must resolve to strings.
1806
1878
  * @maxSize 1000
1807
1879
  */
1808
1880
  expressions?: Expression[];
1809
1881
  }
1810
1882
  export interface StringifyOperation {
1811
- /** Expression to convert to string. */
1883
+ /** Expression to convert into a string. */
1812
1884
  expression?: Expression;
1813
1885
  }
1814
1886
  export interface ToLowerOperation {
1815
- /** Expression to convert to lower case. */
1887
+ /**
1888
+ * Expression to convert to lowercase.
1889
+ *
1890
+ * Expression must resolve to a string.
1891
+ */
1816
1892
  expression?: Expression;
1817
1893
  }
1818
1894
  export interface ToUpperOperation {
1819
- /** Expression to convert to upper case. */
1895
+ /**
1896
+ * Expression to convert to uppercase.
1897
+ *
1898
+ * Expression must resolve to a string.
1899
+ */
1820
1900
  expression?: Expression;
1821
1901
  }
1822
1902
  export interface SubstringOperation {
1823
- /** Expression to extract substring from. */
1903
+ /**
1904
+ * Expression to extract a substring from.
1905
+ *
1906
+ * Expression must resolve to a string.
1907
+ */
1824
1908
  expression?: Expression;
1825
- /** Number expression of start index of substring. */
1909
+ /**
1910
+ * Starting position of the substring to extract. Use zero-based indexing.
1911
+ *
1912
+ * Expression must resolve to a number.
1913
+ */
1826
1914
  startExpression?: Expression;
1827
- /** Number expression of length of substring. */
1915
+ /**
1916
+ * Number of characters to extract from the starting position.
1917
+ *
1918
+ * Expression must resolve to a number.
1919
+ */
1828
1920
  lengthExpression?: Expression;
1829
1921
  }
1830
1922
  export interface LengthOperation {
1831
- /** Expression to calculate length of. */
1923
+ /**
1924
+ * Expression to calculate the character count of.
1925
+ *
1926
+ * Expression must resolve to a string.
1927
+ */
1832
1928
  expression?: Expression;
1833
1929
  }
1834
1930
  export interface Avg {
1835
- /** Expression to be evaluated and used for calculating the average value in the grouping. */
1931
+ /**
1932
+ * Expression by which to calculate the group's average value.
1933
+ *
1934
+ * Expression must resolve to a number.
1935
+ */
1836
1936
  expression?: Expression;
1837
1937
  }
1838
1938
  export interface AccumulatorMin {
1839
- /** Expression to be evaluated and used as the minimum value in the grouping. */
1939
+ /**
1940
+ * Expression by which to find the group's minimum value.
1941
+ *
1942
+ * Expression must resolve to a comparable value, such as a number or string.
1943
+ */
1840
1944
  expression?: Expression;
1841
1945
  }
1842
1946
  export interface AccumulatorMax {
1843
- /** Expression to be evaluated and used as the maximum value in the grouping. */
1947
+ /**
1948
+ * Expression by which to find the group's maximum value.
1949
+ *
1950
+ * Expression must resolve to a comparable value, such as a number or string.
1951
+ */
1844
1952
  expression?: Expression;
1845
1953
  }
1846
1954
  export interface AccumulatorSum {
1847
- /** Expression to be evaluated and used as the sum value in the grouping. */
1955
+ /**
1956
+ * Expression by which to calculate the group's total sum.
1957
+ *
1958
+ * Expression must resolve to a number.
1959
+ */
1848
1960
  expression?: Expression;
1849
1961
  }
1850
1962
  export interface First {
1851
- /** Expression to be evaluated and used as the first value in the grouping. */
1963
+ /** Expression by which to find the first item in the group. */
1852
1964
  expression?: Expression;
1853
1965
  }
1854
1966
  export interface Last {
1855
- /** Expression to be evaluated and used as the last value in the grouping. */
1967
+ /** Expression by which to find the last item in the group. */
1856
1968
  expression?: Expression;
1857
1969
  }
1858
1970
  export interface Push {
1859
- /** Expression to be evaluated and pushed to the resulting document. */
1971
+ /** Expression by which to collect items into an array. */
1860
1972
  expression?: Expression;
1861
1973
  }
1862
1974
  export interface Include {
1863
1975
  /**
1864
- * Field name of the field to be included in the resulting document.
1976
+ * Key of the field to include in the result.
1977
+ *
1978
+ * Use dot notation to specify nested fields, such as `user.name` or `product.price`. 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).
1865
1979
  * @maxLength 1000
1866
1980
  */
1867
1981
  fieldName?: string;
1868
1982
  }
1869
1983
  export interface Exclude {
1870
1984
  /**
1871
- * Field name of the field to be excluded from the resulting document.
1985
+ * Key of the field to exclude from the result.
1986
+ *
1987
+ * Use dot notation to specify nested fields, such as `user.name` or `product.price`. 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).
1872
1988
  * @maxLength 1000
1873
1989
  */
1874
1990
  fieldName?: string;
1875
1991
  }
1876
- export interface ProjectionExpression {
1992
+ export interface Reshape {
1877
1993
  /**
1878
- * Field name of resulting expression
1994
+ * Key of the field to create in the result item.
1995
+ *
1996
+ * 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).
1879
1997
  * @maxLength 1000
1880
1998
  */
1881
- fieldName?: string;
1882
- /** Expression to be evaluated. */
1999
+ resultFieldName?: string;
2000
+ /** Expression to resolve. The result of the expression is the value of the new field. */
1883
2001
  expression?: Expression;
1884
2002
  }
1885
- export interface ProjectionFields {
2003
+ export interface ProjectNested {
1886
2004
  /**
1887
- * Field name of resulting document
2005
+ * Key of the parent field for the nested fields.
2006
+ *
2007
+ * 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).
1888
2008
  * @maxLength 1000
1889
2009
  */
1890
- fieldName?: string;
2010
+ resultFieldName?: string;
1891
2011
  /**
1892
- * Fields to be included in the resulting document.
2012
+ * Nested fields to include, exclude, or calculate by running aggregations.
1893
2013
  * @maxSize 1000
1894
2014
  */
1895
2015
  fields?: Field[];
1896
2016
  }
1897
2017
  export interface Field extends FieldProjectionOneOf {
1898
- /** When used include only specified field in resulting document. */
2018
+ /** When specified, includes only the specified field in the result. All other fields are excluded. */
1899
2019
  include?: Include;
1900
- /** When used all fields are included in resulting document except specified fields. */
2020
+ /** When specified, excludes the specified field from the result. All other fields are included. */
1901
2021
  exclude?: Exclude;
1902
- /** When used new fields created based on underlying arithmetic operations. */
1903
- projectionExpression?: ProjectionExpression;
1904
- /** Nested fields to be projected in the resulting document. */
1905
- projectionFields?: ProjectionFields;
2022
+ /** Reshape a new field based on the specified expression. */
2023
+ reshape?: Reshape;
2024
+ /** Project nested fields by including, excluding, or reshaping new fields. */
2025
+ projectNested?: ProjectNested;
1906
2026
  }
1907
2027
  /** @oneof */
1908
2028
  export interface FieldProjectionOneOf {
1909
- /** When used include only specified field in resulting document. */
2029
+ /** When specified, includes only the specified field in the result. All other fields are excluded. */
1910
2030
  include?: Include;
1911
- /** When used all fields are included in resulting document except specified fields. */
2031
+ /** When specified, excludes the specified field from the result. All other fields are included. */
1912
2032
  exclude?: Exclude;
1913
- /** When used new fields created based on underlying arithmetic operations. */
1914
- projectionExpression?: ProjectionExpression;
1915
- /** Nested fields to be projected in the resulting document. */
1916
- projectionFields?: ProjectionFields;
2033
+ /** Reshape a new field based on the specified expression. */
2034
+ reshape?: Reshape;
2035
+ /** Project nested fields by including, excluding, or reshaping new fields. */
2036
+ projectNested?: ProjectNested;
1917
2037
  }
1918
- export interface Id {
2038
+ export interface GroupId {
1919
2039
  /**
1920
- * Group identifier key.
2040
+ * Name of the field to group items by.
2041
+ *
2042
+ * This becomes the field name in the result's `_id` property.
1921
2043
  * @maxLength 1000
1922
2044
  */
1923
2045
  key?: string;
1924
- /** Group expression value. */
2046
+ /** Expression by which to determine the grouping value. Items whose expression resolves to the same value are grouped together in the result item's `_id` property. */
1925
2047
  expression?: Expression;
1926
2048
  }
1927
2049
  export interface Accumulator extends AccumulatorExpressionOneOf {
1928
- /** Calculate the average value of a specified field for all items in the grouping. */
2050
+ /** Calculates the average value across all items in the group, based on the specified expression. */
1929
2051
  avg?: Avg;
1930
- /** Calculate the minimum value of a specified field for all items in the grouping. */
2052
+ /** Finds the minimum value across all items in the group. */
1931
2053
  min?: AccumulatorMin;
1932
- /** Calculate the maximum value of a specified field for all items in the grouping. */
2054
+ /** Finds the maximum value across all items in the group. */
1933
2055
  max?: AccumulatorMax;
1934
- /** Calculate the sum of values of a specified field for all items in the grouping. */
2056
+ /** Calculates the sum of the specified expression across all items in the group. */
1935
2057
  sum?: AccumulatorSum;
1936
- /** Use first result from calculated grouping. */
2058
+ /** Finds the first item in the group. */
1937
2059
  first?: First;
1938
- /** Use last result from calculated grouping. */
2060
+ /** Finds the last item in the group. */
1939
2061
  last?: Last;
1940
- /** Execute calculation by group & push result to resulting group document. */
2062
+ /** Collects values from all items in the group into an array. */
1941
2063
  push?: Push;
1942
2064
  /**
1943
- * Accumulator result field name.
2065
+ * Key of the field to create in the output item to contain the aggregation result.
1944
2066
  * @maxLength 1000
1945
2067
  */
1946
2068
  resultFieldName?: string;
1947
2069
  }
1948
2070
  /** @oneof */
1949
2071
  export interface AccumulatorExpressionOneOf {
1950
- /** Calculate the average value of a specified field for all items in the grouping. */
2072
+ /** Calculates the average value across all items in the group, based on the specified expression. */
1951
2073
  avg?: Avg;
1952
- /** Calculate the minimum value of a specified field for all items in the grouping. */
2074
+ /** Finds the minimum value across all items in the group. */
1953
2075
  min?: AccumulatorMin;
1954
- /** Calculate the maximum value of a specified field for all items in the grouping. */
2076
+ /** Finds the maximum value across all items in the group. */
1955
2077
  max?: AccumulatorMax;
1956
- /** Calculate the sum of values of a specified field for all items in the grouping. */
2078
+ /** Calculates the sum of the specified expression across all items in the group. */
1957
2079
  sum?: AccumulatorSum;
1958
- /** Use first result from calculated grouping. */
2080
+ /** Finds the first item in the group. */
1959
2081
  first?: First;
1960
- /** Use last result from calculated grouping. */
2082
+ /** Finds the last item in the group. */
1961
2083
  last?: Last;
1962
- /** Execute calculation by group & push result to resulting group document. */
2084
+ /** Collects values from all items in the group into an array. */
1963
2085
  push?: Push;
1964
2086
  }
1965
2087
  export interface Group {
1966
2088
  /**
1967
- * Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection.
2089
+ * Grouping criteria by which to organize items.
2090
+ *
2091
+ * Each `Id` specifies a field by which to group items, and serves as the result item's unique `_id` property.
2092
+ *
2093
+ * Collection items with identical values for the specified `expression` are placed in the same group based on the specified `key`. If empty, all items are treated as a single group.
1968
2094
  * @maxSize 1000
1969
2095
  */
1970
- ids?: Id[];
2096
+ groupIds?: GroupId[];
1971
2097
  /**
1972
- * Operations to carry out on the data in each grouping.
2098
+ * Accumulation operations to run on each group.
2099
+ *
2100
+ * Accumulators aggregate data across all items in the group and return the result in a new field.
2101
+ *
2102
+ * > **Note:** When using accumulators, the type of expression must match the operation type. For example, when using the `sum` accumulator, the specified expression must resolve to a number.
1973
2103
  * @maxSize 1000
1974
2104
  */
1975
2105
  accumulators?: Accumulator[];
1976
2106
  }
1977
2107
  export interface AggregatePipelineDataItemsRequestSorting {
1978
2108
  /**
1979
- * Sort by one or more fields.
2109
+ * Fields to sort the results by.
1980
2110
  * @maxSize 1000
1981
2111
  */
1982
2112
  values?: Sorting[];
1983
2113
  }
1984
- /** Project document to include specific fields, rename or perform arithmetic operations on them. */
2114
+ /** Transform individual collection items by including, excluding, or calculating new fields based on aggregations. */
1985
2115
  export interface Projection {
1986
2116
  /**
1987
- * Field transformation projections.
2117
+ * Nested fields to include, exclude, or calculate by running aggregations.
1988
2118
  * @maxSize 1000
1989
2119
  */
1990
2120
  fields?: Field[];
1991
2121
  }
1992
- /** Transform object to array. */
2122
+ /** Convert an object into an array. */
1993
2123
  export interface ObjectToArray {
1994
2124
  /**
1995
- * Field name of source document array field
2125
+ * Key of the field to convert into an array.
2126
+ *
2127
+ * Use dot notation to specify nested fields, such as `user.name` or `product.price`. 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).
1996
2128
  * @maxLength 1000
1997
2129
  */
1998
- arrayFieldName?: string;
2130
+ objectFieldName?: string;
1999
2131
  /**
2000
- * Target field name for the projected document.
2132
+ * Key of the new array to create in the result item.
2133
+ *
2134
+ * 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).
2001
2135
  * @maxLength 1000
2002
2136
  */
2003
2137
  destinationFieldName?: string;
2004
2138
  }
2005
- /** Unwind array field. */
2139
+ /** Unwind an array. */
2006
2140
  export interface UnwindArray {
2007
2141
  /**
2008
- * Field name of source document array field
2142
+ * Key of the array field to unwind.
2143
+ *
2144
+ * Use dot notation to specify a nested array, such as `user.products` or `product.price`. 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).
2009
2145
  * @maxLength 1000
2010
2146
  */
2011
2147
  arrayFieldName?: string;
2012
2148
  }
2013
2149
  export interface Stage extends StageStageOneOf {
2014
- /** Grouping stage. */
2150
+ /**
2151
+ * Group.
2152
+ *
2153
+ * Groups aggregate data across multiple collection items and create new result items.
2154
+ */
2015
2155
  group?: Group;
2016
2156
  /**
2017
- * Filtering stage. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.
2157
+ * Aggregation filter. Only collection items that match the filter are processed.
2018
2158
  *
2019
- * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
2159
+ * Learn more about [filters in API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language#filters).
2160
+ *
2161
+ * > **Note:** The values you provide for each filter field must adhere to that field's data type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
2020
2162
  */
2021
2163
  filter?: Record<string, any> | null;
2022
2164
  /**
2023
- * Sort object in the following format:
2024
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
2165
+ * Sorting preferences.
2166
+ *
2167
+ * Learn more about [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
2025
2168
  */
2026
2169
  sort?: AggregatePipelineDataItemsRequestSorting;
2027
- /** Project document to include specific fields with possibility of renaming them. */
2170
+ /** Transform collection items by including, excluding, or calculating new fields. */
2028
2171
  projection?: Projection;
2029
- /** Transform object to array. */
2172
+ /** Convert an object into an array. Each property becomes an element in the new array. Each new array element also includes all other fields from the original object. */
2030
2173
  objectToArray?: ObjectToArray;
2031
- /** Unwind array field. */
2174
+ /**
2175
+ * Deconstructs an array field into separate result items.
2176
+ *
2177
+ * Creates a new result object for each element in the specified array. Each new object contains the array element's value, as well as all other fields from the original element.
2178
+ */
2032
2179
  unwindArray?: UnwindArray;
2033
- /** Skip resulting documents. */
2180
+ /** Number of results to skip from the beginning of the result set. */
2034
2181
  skip?: number;
2035
- /** Limit the number of resulting documents. */
2182
+ /** Maximum number of results to return. */
2036
2183
  limit?: number;
2037
2184
  }
2038
2185
  /** @oneof */
2039
2186
  export interface StageStageOneOf {
2040
- /** Grouping stage. */
2187
+ /**
2188
+ * Group.
2189
+ *
2190
+ * Groups aggregate data across multiple collection items and create new result items.
2191
+ */
2041
2192
  group?: Group;
2042
2193
  /**
2043
- * Filtering stage. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.
2194
+ * Aggregation filter. Only collection items that match the filter are processed.
2044
2195
  *
2045
- * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
2196
+ * Learn more about [filters in API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language#filters).
2197
+ *
2198
+ * > **Note:** The values you provide for each filter field must adhere to that field's data type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).
2046
2199
  */
2047
2200
  filter?: Record<string, any> | null;
2048
2201
  /**
2049
- * Sort object in the following format:
2050
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
2202
+ * Sorting preferences.
2203
+ *
2204
+ * Learn more about [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
2051
2205
  */
2052
2206
  sort?: AggregatePipelineDataItemsRequestSorting;
2053
- /** Project document to include specific fields with possibility of renaming them. */
2207
+ /** Transform collection items by including, excluding, or calculating new fields. */
2054
2208
  projection?: Projection;
2055
- /** Transform object to array. */
2209
+ /** Convert an object into an array. Each property becomes an element in the new array. Each new array element also includes all other fields from the original object. */
2056
2210
  objectToArray?: ObjectToArray;
2057
- /** Unwind array field. */
2211
+ /**
2212
+ * Deconstructs an array field into separate result items.
2213
+ *
2214
+ * Creates a new result object for each element in the specified array. Each new object contains the array element's value, as well as all other fields from the original element.
2215
+ */
2058
2216
  unwindArray?: UnwindArray;
2059
- /** Skip resulting documents. */
2217
+ /** Number of results to skip from the beginning of the result set. */
2060
2218
  skip?: number;
2061
- /** Limit the number of resulting documents. */
2219
+ /** Maximum number of results to return. */
2062
2220
  limit?: number;
2063
2221
  }
2064
2222
  export interface AggregatePipelineDataItemsResponse {