@wix/wix-data-items-common 1.0.207 → 1.0.209
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 +36 -0
- package/dist/cjs/api/PipelineBuilder.js.map +1 -0
- package/dist/cjs/api/WixDataApi.js +14 -4
- package/dist/cjs/api/WixDataApi.js.map +1 -1
- package/dist/cjs/api/index.js +3 -3
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/types/data-item-types.js +3 -3
- package/dist/cjs/types/data-item-types.js.map +1 -1
- package/dist/esm/api/PipelineBuilder.js +23 -0
- package/dist/esm/api/PipelineBuilder.js.map +1 -0
- package/dist/esm/api/WixDataApi.js +15 -4
- package/dist/esm/api/WixDataApi.js.map +1 -1
- package/dist/esm/api/index.js +1 -0
- package/dist/esm/api/index.js.map +1 -1
- package/dist/types/api/PipelineBuilder.d.ts +11 -0
- package/dist/types/api/PipelineBuilder.d.ts.map +1 -0
- package/dist/types/api/WixDataApi.d.ts +2 -4
- package/dist/types/api/WixDataApi.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +1 -1
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/types/data-item-types.d.ts +150 -142
- package/dist/types/types/data-item-types.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/cjs/api/PipelineValidator.js +0 -26
- package/dist/cjs/api/PipelineValidator.js.map +0 -1
- package/dist/cjs/api/WixDataAggregatePipeline.js +0 -4
- package/dist/cjs/api/WixDataAggregatePipeline.js.map +0 -1
- package/dist/cjs/api/impl/WixDataAggregatePipelineImpl.js +0 -96
- package/dist/cjs/api/impl/WixDataAggregatePipelineImpl.js.map +0 -1
- package/dist/esm/api/PipelineValidator.js +0 -18
- package/dist/esm/api/PipelineValidator.js.map +0 -1
- package/dist/esm/api/WixDataAggregatePipeline.js +0 -2
- package/dist/esm/api/WixDataAggregatePipeline.js.map +0 -1
- package/dist/esm/api/impl/WixDataAggregatePipelineImpl.js +0 -76
- package/dist/esm/api/impl/WixDataAggregatePipelineImpl.js.map +0 -1
- package/dist/types/api/PipelineValidator.d.ts +0 -9
- package/dist/types/api/PipelineValidator.d.ts.map +0 -1
- package/dist/types/api/WixDataAggregatePipeline.d.ts +0 -62
- package/dist/types/api/WixDataAggregatePipeline.d.ts.map +0 -1
- package/dist/types/api/impl/WixDataAggregatePipelineImpl.d.ts +0 -21
- package/dist/types/api/impl/WixDataAggregatePipelineImpl.d.ts.map +0 -1
|
@@ -1589,19 +1589,13 @@ export interface SearchDataItemsResponse {
|
|
|
1589
1589
|
/** Paging information. */
|
|
1590
1590
|
pagingMetadata?: PagingMetadataV2;
|
|
1591
1591
|
}
|
|
1592
|
-
export interface
|
|
1593
|
-
/**
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
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
|
-
*/
|
|
1604
|
-
cursorPaging?: CursorPaging;
|
|
1592
|
+
export interface AggregateDataItemsResponse {
|
|
1593
|
+
/** Aggregation results. */
|
|
1594
|
+
results?: Record<string, any>[] | null;
|
|
1595
|
+
/** Paging information. */
|
|
1596
|
+
pagingMetadata?: PagingMetadataV2;
|
|
1597
|
+
}
|
|
1598
|
+
export interface AggregatePipelineDataItemsRequest {
|
|
1605
1599
|
/**
|
|
1606
1600
|
* Environment: `LIVE` or `SANDBOX`.
|
|
1607
1601
|
* @internal
|
|
@@ -1612,21 +1606,14 @@ export interface AggregatePipelineDataItemsRequest extends AggregatePipelineData
|
|
|
1612
1606
|
* @maxLength 256
|
|
1613
1607
|
*/
|
|
1614
1608
|
dataCollectionId: string;
|
|
1609
|
+
/** Aggregation pipeline configuration containing stages and paging options. */
|
|
1610
|
+
pipeline?: AggregationPipeline;
|
|
1615
1611
|
/**
|
|
1616
|
-
*
|
|
1617
|
-
*
|
|
1618
|
-
* Stages are processed in order, with each stage operating on the output of the previous stage.
|
|
1619
|
-
* @maxSize 100
|
|
1620
|
-
*/
|
|
1621
|
-
stages?: Stage[];
|
|
1622
|
-
/**
|
|
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.
|
|
1612
|
+
* Whether to return the total result count when running a query with offset paging. When `true`, the `pagingMetadata` property in the response contains a `total` field.
|
|
1626
1613
|
*
|
|
1627
1614
|
* Learn more about [offset paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging#paging).
|
|
1628
1615
|
*
|
|
1629
|
-
* Default: `false
|
|
1616
|
+
* Default: `false`.
|
|
1630
1617
|
*/
|
|
1631
1618
|
returnTotalCount?: boolean;
|
|
1632
1619
|
/**
|
|
@@ -1642,7 +1629,7 @@ export interface AggregatePipelineDataItemsRequest extends AggregatePipelineData
|
|
|
1642
1629
|
*
|
|
1643
1630
|
* Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).
|
|
1644
1631
|
*
|
|
1645
|
-
* Default: `false
|
|
1632
|
+
* Default: `false`.
|
|
1646
1633
|
*/
|
|
1647
1634
|
consistentRead?: boolean;
|
|
1648
1635
|
/**
|
|
@@ -1650,9 +1637,9 @@ export interface AggregatePipelineDataItemsRequest extends AggregatePipelineData
|
|
|
1650
1637
|
*
|
|
1651
1638
|
* When provided, the aggregation runs on items in the specified language. When not provided, the aggregation runs on items in the default language.
|
|
1652
1639
|
*
|
|
1653
|
-
* > **Note:**
|
|
1640
|
+
* > **Note:** The Wix user must enable translation for the specified language in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).
|
|
1654
1641
|
*
|
|
1655
|
-
* Learn more about [
|
|
1642
|
+
* Learn more about [using Wix Multilingual to translate CMS content](https://support.wix.com/en/article/wix-multilingual-translating-cms-collection-content).
|
|
1656
1643
|
* @format LANGUAGE_TAG
|
|
1657
1644
|
*/
|
|
1658
1645
|
language?: string | null;
|
|
@@ -1669,26 +1656,11 @@ export interface AggregatePipelineDataItemsRequest extends AggregatePipelineData
|
|
|
1669
1656
|
*/
|
|
1670
1657
|
publishPluginOptions?: DataPublishPluginOptions;
|
|
1671
1658
|
}
|
|
1672
|
-
/** @oneof */
|
|
1673
|
-
export interface AggregatePipelineDataItemsRequestPagingMethodOneOf {
|
|
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
|
-
*/
|
|
1679
|
-
paging?: Paging;
|
|
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
|
-
*/
|
|
1685
|
-
cursorPaging?: CursorPaging;
|
|
1686
|
-
}
|
|
1687
1659
|
export interface Expression extends ExpressionValueOneOf {
|
|
1688
1660
|
/**
|
|
1689
|
-
* Path to the field
|
|
1661
|
+
* Path to the field containing the value to resolve.
|
|
1690
1662
|
*
|
|
1691
|
-
* Use dot notation to specify nested fields
|
|
1663
|
+
* Use dot notation to specify nested fields. For example, `user.name` or `product.price`.
|
|
1692
1664
|
* @maxLength 1000
|
|
1693
1665
|
*/
|
|
1694
1666
|
fieldPath?: string;
|
|
@@ -1697,7 +1669,7 @@ export interface Expression extends ExpressionValueOneOf {
|
|
|
1697
1669
|
* @maxLength 1000
|
|
1698
1670
|
*/
|
|
1699
1671
|
text?: string;
|
|
1700
|
-
/**
|
|
1672
|
+
/** Number value. */
|
|
1701
1673
|
numeric?: number;
|
|
1702
1674
|
/** Adds the specified expressions together. */
|
|
1703
1675
|
add?: AddOperation;
|
|
@@ -1717,13 +1689,13 @@ export interface Expression extends ExpressionValueOneOf {
|
|
|
1717
1689
|
floor?: FloorOperation;
|
|
1718
1690
|
/** Rounds an expression up to the nearest whole number. */
|
|
1719
1691
|
ceil?: CeilOperation;
|
|
1720
|
-
/** Joins multiple expressions together to create a
|
|
1692
|
+
/** Joins multiple expressions together to create a string. */
|
|
1721
1693
|
concat?: ConcatOperation;
|
|
1722
|
-
/** Converts an expression
|
|
1694
|
+
/** Converts an expression to a string. */
|
|
1723
1695
|
stringify?: StringifyOperation;
|
|
1724
|
-
/** Converts an expression
|
|
1696
|
+
/** Converts an expression to lowercase. */
|
|
1725
1697
|
toLower?: ToLowerOperation;
|
|
1726
|
-
/** Converts an expression
|
|
1698
|
+
/** Converts an expression to uppercase. */
|
|
1727
1699
|
toUpper?: ToUpperOperation;
|
|
1728
1700
|
/** Extracts a portion of a string expression. */
|
|
1729
1701
|
substring?: SubstringOperation;
|
|
@@ -1733,9 +1705,9 @@ export interface Expression extends ExpressionValueOneOf {
|
|
|
1733
1705
|
/** @oneof */
|
|
1734
1706
|
export interface ExpressionValueOneOf {
|
|
1735
1707
|
/**
|
|
1736
|
-
* Path to the field
|
|
1708
|
+
* Path to the field containing the value to resolve.
|
|
1737
1709
|
*
|
|
1738
|
-
* Use dot notation to specify nested fields
|
|
1710
|
+
* Use dot notation to specify nested fields. For example, `user.name` or `product.price`.
|
|
1739
1711
|
* @maxLength 1000
|
|
1740
1712
|
*/
|
|
1741
1713
|
fieldPath?: string;
|
|
@@ -1744,7 +1716,7 @@ export interface ExpressionValueOneOf {
|
|
|
1744
1716
|
* @maxLength 1000
|
|
1745
1717
|
*/
|
|
1746
1718
|
text?: string;
|
|
1747
|
-
/**
|
|
1719
|
+
/** Number value. */
|
|
1748
1720
|
numeric?: number;
|
|
1749
1721
|
/** Adds the specified expressions together. */
|
|
1750
1722
|
add?: AddOperation;
|
|
@@ -1764,13 +1736,13 @@ export interface ExpressionValueOneOf {
|
|
|
1764
1736
|
floor?: FloorOperation;
|
|
1765
1737
|
/** Rounds an expression up to the nearest whole number. */
|
|
1766
1738
|
ceil?: CeilOperation;
|
|
1767
|
-
/** Joins multiple expressions together to create a
|
|
1739
|
+
/** Joins multiple expressions together to create a string. */
|
|
1768
1740
|
concat?: ConcatOperation;
|
|
1769
|
-
/** Converts an expression
|
|
1741
|
+
/** Converts an expression to a string. */
|
|
1770
1742
|
stringify?: StringifyOperation;
|
|
1771
|
-
/** Converts an expression
|
|
1743
|
+
/** Converts an expression to lowercase. */
|
|
1772
1744
|
toLower?: ToLowerOperation;
|
|
1773
|
-
/** Converts an expression
|
|
1745
|
+
/** Converts an expression to uppercase. */
|
|
1774
1746
|
toUpper?: ToUpperOperation;
|
|
1775
1747
|
/** Extracts a portion of a string expression. */
|
|
1776
1748
|
substring?: SubstringOperation;
|
|
@@ -1813,7 +1785,7 @@ export interface MultiplyOperation {
|
|
|
1813
1785
|
/**
|
|
1814
1786
|
* Expressions to multiply.
|
|
1815
1787
|
*
|
|
1816
|
-
*
|
|
1788
|
+
* All expressions must resolve to numbers.
|
|
1817
1789
|
* @maxSize 1000
|
|
1818
1790
|
*/
|
|
1819
1791
|
expressions?: Expression[];
|
|
@@ -1842,7 +1814,7 @@ export interface AbsOperation {
|
|
|
1842
1814
|
}
|
|
1843
1815
|
export interface ModOperation {
|
|
1844
1816
|
/**
|
|
1845
|
-
* Expression to divide by `secondExpression
|
|
1817
|
+
* Expression to divide by `secondExpression` to find the remainder.
|
|
1846
1818
|
*
|
|
1847
1819
|
* Expression must resolve to a number.
|
|
1848
1820
|
*/
|
|
@@ -1874,13 +1846,13 @@ export interface ConcatOperation {
|
|
|
1874
1846
|
/**
|
|
1875
1847
|
* Expressions to join together.
|
|
1876
1848
|
*
|
|
1877
|
-
*
|
|
1849
|
+
* All expressions must resolve to strings.
|
|
1878
1850
|
* @maxSize 1000
|
|
1879
1851
|
*/
|
|
1880
1852
|
expressions?: Expression[];
|
|
1881
1853
|
}
|
|
1882
1854
|
export interface StringifyOperation {
|
|
1883
|
-
/** Expression to convert
|
|
1855
|
+
/** Expression to convert to a string. */
|
|
1884
1856
|
expression?: Expression;
|
|
1885
1857
|
}
|
|
1886
1858
|
export interface ToLowerOperation {
|
|
@@ -1907,7 +1879,7 @@ export interface SubstringOperation {
|
|
|
1907
1879
|
*/
|
|
1908
1880
|
expression?: Expression;
|
|
1909
1881
|
/**
|
|
1910
|
-
* Starting position of the substring to extract
|
|
1882
|
+
* Starting position of the substring to extract, specified in zero-based indexing.
|
|
1911
1883
|
*
|
|
1912
1884
|
* Expression must resolve to a number.
|
|
1913
1885
|
*/
|
|
@@ -1921,7 +1893,7 @@ export interface SubstringOperation {
|
|
|
1921
1893
|
}
|
|
1922
1894
|
export interface LengthOperation {
|
|
1923
1895
|
/**
|
|
1924
|
-
* Expression to
|
|
1896
|
+
* Expression to count the total number of characters of.
|
|
1925
1897
|
*
|
|
1926
1898
|
* Expression must resolve to a string.
|
|
1927
1899
|
*/
|
|
@@ -1929,7 +1901,7 @@ export interface LengthOperation {
|
|
|
1929
1901
|
}
|
|
1930
1902
|
export interface Avg {
|
|
1931
1903
|
/**
|
|
1932
|
-
* Expression
|
|
1904
|
+
* Expression to calculate the group's average value.
|
|
1933
1905
|
*
|
|
1934
1906
|
* Expression must resolve to a number.
|
|
1935
1907
|
*/
|
|
@@ -1937,7 +1909,7 @@ export interface Avg {
|
|
|
1937
1909
|
}
|
|
1938
1910
|
export interface AccumulatorMin {
|
|
1939
1911
|
/**
|
|
1940
|
-
* Expression
|
|
1912
|
+
* Expression to find the group's minimum value.
|
|
1941
1913
|
*
|
|
1942
1914
|
* Expression must resolve to a comparable value, such as a number or string.
|
|
1943
1915
|
*/
|
|
@@ -1945,7 +1917,7 @@ export interface AccumulatorMin {
|
|
|
1945
1917
|
}
|
|
1946
1918
|
export interface AccumulatorMax {
|
|
1947
1919
|
/**
|
|
1948
|
-
* Expression
|
|
1920
|
+
* Expression to find the group's maximum value.
|
|
1949
1921
|
*
|
|
1950
1922
|
* Expression must resolve to a comparable value, such as a number or string.
|
|
1951
1923
|
*/
|
|
@@ -1953,29 +1925,29 @@ export interface AccumulatorMax {
|
|
|
1953
1925
|
}
|
|
1954
1926
|
export interface AccumulatorSum {
|
|
1955
1927
|
/**
|
|
1956
|
-
* Expression
|
|
1928
|
+
* Expression to calculate the group's total sum.
|
|
1957
1929
|
*
|
|
1958
1930
|
* Expression must resolve to a number.
|
|
1959
1931
|
*/
|
|
1960
1932
|
expression?: Expression;
|
|
1961
1933
|
}
|
|
1962
1934
|
export interface First {
|
|
1963
|
-
/** Expression
|
|
1935
|
+
/** Expression to find the first item in the group. */
|
|
1964
1936
|
expression?: Expression;
|
|
1965
1937
|
}
|
|
1966
1938
|
export interface Last {
|
|
1967
|
-
/** Expression
|
|
1939
|
+
/** Expression to find the last item in the group. */
|
|
1968
1940
|
expression?: Expression;
|
|
1969
1941
|
}
|
|
1970
1942
|
export interface Push {
|
|
1971
|
-
/** Expression
|
|
1943
|
+
/** Expression to collect items into an array. */
|
|
1972
1944
|
expression?: Expression;
|
|
1973
1945
|
}
|
|
1974
1946
|
export interface Include {
|
|
1975
1947
|
/**
|
|
1976
1948
|
* Key of the field to include in the result.
|
|
1977
1949
|
*
|
|
1978
|
-
* Use dot notation to specify nested fields
|
|
1950
|
+
* Use dot notation to specify nested fields. For example, `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).
|
|
1979
1951
|
* @maxLength 1000
|
|
1980
1952
|
*/
|
|
1981
1953
|
fieldName?: string;
|
|
@@ -1984,7 +1956,7 @@ export interface Exclude {
|
|
|
1984
1956
|
/**
|
|
1985
1957
|
* Key of the field to exclude from the result.
|
|
1986
1958
|
*
|
|
1987
|
-
* Use dot notation to specify nested fields
|
|
1959
|
+
* Use dot notation to specify nested fields. For example, `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).
|
|
1988
1960
|
* @maxLength 1000
|
|
1989
1961
|
*/
|
|
1990
1962
|
fieldName?: string;
|
|
@@ -1997,7 +1969,7 @@ export interface Reshape {
|
|
|
1997
1969
|
* @maxLength 1000
|
|
1998
1970
|
*/
|
|
1999
1971
|
resultFieldName?: string;
|
|
2000
|
-
/** Expression to resolve. The result of the expression
|
|
1972
|
+
/** Expression to resolve. The result of the expression becomes the value of the new field. */
|
|
2001
1973
|
expression?: Expression;
|
|
2002
1974
|
}
|
|
2003
1975
|
export interface ProjectNested {
|
|
@@ -2009,7 +1981,7 @@ export interface ProjectNested {
|
|
|
2009
1981
|
*/
|
|
2010
1982
|
resultFieldName?: string;
|
|
2011
1983
|
/**
|
|
2012
|
-
* Nested fields to include, exclude, or
|
|
1984
|
+
* Nested fields to include, exclude, or reshape.
|
|
2013
1985
|
* @maxSize 1000
|
|
2014
1986
|
*/
|
|
2015
1987
|
fields?: Field[];
|
|
@@ -2019,9 +1991,9 @@ export interface Field extends FieldProjectionOneOf {
|
|
|
2019
1991
|
include?: Include;
|
|
2020
1992
|
/** When specified, excludes the specified field from the result. All other fields are included. */
|
|
2021
1993
|
exclude?: Exclude;
|
|
2022
|
-
/**
|
|
1994
|
+
/** Reshapes a new field based on the specified expression. */
|
|
2023
1995
|
reshape?: Reshape;
|
|
2024
|
-
/**
|
|
1996
|
+
/** Creates nested fields by including, excluding, or reshaping fields. */
|
|
2025
1997
|
projectNested?: ProjectNested;
|
|
2026
1998
|
}
|
|
2027
1999
|
/** @oneof */
|
|
@@ -2030,9 +2002,9 @@ export interface FieldProjectionOneOf {
|
|
|
2030
2002
|
include?: Include;
|
|
2031
2003
|
/** When specified, excludes the specified field from the result. All other fields are included. */
|
|
2032
2004
|
exclude?: Exclude;
|
|
2033
|
-
/**
|
|
2005
|
+
/** Reshapes a new field based on the specified expression. */
|
|
2034
2006
|
reshape?: Reshape;
|
|
2035
|
-
/**
|
|
2007
|
+
/** Creates nested fields by including, excluding, or reshaping fields. */
|
|
2036
2008
|
projectNested?: ProjectNested;
|
|
2037
2009
|
}
|
|
2038
2010
|
export interface GroupId {
|
|
@@ -2043,11 +2015,11 @@ export interface GroupId {
|
|
|
2043
2015
|
* @maxLength 1000
|
|
2044
2016
|
*/
|
|
2045
2017
|
key?: string;
|
|
2046
|
-
/** Expression
|
|
2018
|
+
/** Expression to determine the grouping value. Items whose expression resolves to the same value are grouped together in the result item's `_id` property. */
|
|
2047
2019
|
expression?: Expression;
|
|
2048
2020
|
}
|
|
2049
2021
|
export interface Accumulator extends AccumulatorExpressionOneOf {
|
|
2050
|
-
/** Calculates the average value across all items in the group
|
|
2022
|
+
/** Calculates the average value across all items in the group based on the specified expression. */
|
|
2051
2023
|
avg?: Avg;
|
|
2052
2024
|
/** Finds the minimum value across all items in the group. */
|
|
2053
2025
|
min?: AccumulatorMin;
|
|
@@ -2069,7 +2041,7 @@ export interface Accumulator extends AccumulatorExpressionOneOf {
|
|
|
2069
2041
|
}
|
|
2070
2042
|
/** @oneof */
|
|
2071
2043
|
export interface AccumulatorExpressionOneOf {
|
|
2072
|
-
/** Calculates the average value across all items in the group
|
|
2044
|
+
/** Calculates the average value across all items in the group based on the specified expression. */
|
|
2073
2045
|
avg?: Avg;
|
|
2074
2046
|
/** Finds the minimum value across all items in the group. */
|
|
2075
2047
|
min?: AccumulatorMin;
|
|
@@ -2084,11 +2056,84 @@ export interface AccumulatorExpressionOneOf {
|
|
|
2084
2056
|
/** Collects values from all items in the group into an array. */
|
|
2085
2057
|
push?: Push;
|
|
2086
2058
|
}
|
|
2059
|
+
export interface Stage extends StageStageOneOf {
|
|
2060
|
+
/** Groups aggregated items to new result items. */
|
|
2061
|
+
group?: Group;
|
|
2062
|
+
/**
|
|
2063
|
+
* Aggregation filter. Only collection items that match the filter are processed.
|
|
2064
|
+
*
|
|
2065
|
+
* Learn more about [filters in API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language#filters).
|
|
2066
|
+
*
|
|
2067
|
+
* > **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).
|
|
2068
|
+
*/
|
|
2069
|
+
filter?: Record<string, any> | null;
|
|
2070
|
+
/**
|
|
2071
|
+
* Sorting preferences.
|
|
2072
|
+
*
|
|
2073
|
+
* Learn more about [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
|
|
2074
|
+
*/
|
|
2075
|
+
sort?: AggregatePipelineDataItemsRequestSorting;
|
|
2076
|
+
/** Transforms collection items by including, excluding, or reshaping fields. */
|
|
2077
|
+
projection?: Projection;
|
|
2078
|
+
/**
|
|
2079
|
+
* Converts an object to an array.
|
|
2080
|
+
*
|
|
2081
|
+
* Each property becomes an element in the new array that includes all other fields from the original object.
|
|
2082
|
+
*/
|
|
2083
|
+
objectToArray?: ObjectToArray;
|
|
2084
|
+
/**
|
|
2085
|
+
* Unwinds an array into separate result items.
|
|
2086
|
+
*
|
|
2087
|
+
* Creates a new result object for each array element. Each new object contains the array element's value and all other fields from the original object.
|
|
2088
|
+
*/
|
|
2089
|
+
unwindArray?: UnwindArray;
|
|
2090
|
+
/** Number of results to skip from the beginning of the result set. */
|
|
2091
|
+
skip?: number;
|
|
2092
|
+
/** Maximum number of results to return. */
|
|
2093
|
+
limit?: number;
|
|
2094
|
+
}
|
|
2095
|
+
/** @oneof */
|
|
2096
|
+
export interface StageStageOneOf {
|
|
2097
|
+
/** Groups aggregated items to new result items. */
|
|
2098
|
+
group?: Group;
|
|
2099
|
+
/**
|
|
2100
|
+
* Aggregation filter. Only collection items that match the filter are processed.
|
|
2101
|
+
*
|
|
2102
|
+
* Learn more about [filters in API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language#filters).
|
|
2103
|
+
*
|
|
2104
|
+
* > **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).
|
|
2105
|
+
*/
|
|
2106
|
+
filter?: Record<string, any> | null;
|
|
2107
|
+
/**
|
|
2108
|
+
* Sorting preferences.
|
|
2109
|
+
*
|
|
2110
|
+
* Learn more about [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
|
|
2111
|
+
*/
|
|
2112
|
+
sort?: AggregatePipelineDataItemsRequestSorting;
|
|
2113
|
+
/** Transforms collection items by including, excluding, or reshaping fields. */
|
|
2114
|
+
projection?: Projection;
|
|
2115
|
+
/**
|
|
2116
|
+
* Converts an object to an array.
|
|
2117
|
+
*
|
|
2118
|
+
* Each property becomes an element in the new array that includes all other fields from the original object.
|
|
2119
|
+
*/
|
|
2120
|
+
objectToArray?: ObjectToArray;
|
|
2121
|
+
/**
|
|
2122
|
+
* Unwinds an array into separate result items.
|
|
2123
|
+
*
|
|
2124
|
+
* Creates a new result object for each array element. Each new object contains the array element's value and all other fields from the original object.
|
|
2125
|
+
*/
|
|
2126
|
+
unwindArray?: UnwindArray;
|
|
2127
|
+
/** Number of results to skip from the beginning of the result set. */
|
|
2128
|
+
skip?: number;
|
|
2129
|
+
/** Maximum number of results to return. */
|
|
2130
|
+
limit?: number;
|
|
2131
|
+
}
|
|
2087
2132
|
export interface Group {
|
|
2088
2133
|
/**
|
|
2089
2134
|
* Grouping criteria by which to organize items.
|
|
2090
2135
|
*
|
|
2091
|
-
* Each `
|
|
2136
|
+
* Each `groupId` specifies a field by which to group items, and serves as the result item's unique `_id` property.
|
|
2092
2137
|
*
|
|
2093
2138
|
* 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.
|
|
2094
2139
|
* @maxSize 1000
|
|
@@ -2111,20 +2156,20 @@ export interface AggregatePipelineDataItemsRequestSorting {
|
|
|
2111
2156
|
*/
|
|
2112
2157
|
values?: Sorting[];
|
|
2113
2158
|
}
|
|
2114
|
-
/**
|
|
2159
|
+
/** Transforms collection items by including, excluding, or reshaping fields. */
|
|
2115
2160
|
export interface Projection {
|
|
2116
2161
|
/**
|
|
2117
|
-
*
|
|
2162
|
+
* Fields to include, exclude, or reshape.
|
|
2118
2163
|
* @maxSize 1000
|
|
2119
2164
|
*/
|
|
2120
2165
|
fields?: Field[];
|
|
2121
2166
|
}
|
|
2122
|
-
/**
|
|
2167
|
+
/** Converts an object to an array. */
|
|
2123
2168
|
export interface ObjectToArray {
|
|
2124
2169
|
/**
|
|
2125
|
-
* Key of the field to convert
|
|
2170
|
+
* Key of the object field to convert to an array.
|
|
2126
2171
|
*
|
|
2127
|
-
* Use dot notation to specify nested fields
|
|
2172
|
+
* Use dot notation to specify nested fields. For example, `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).
|
|
2128
2173
|
* @maxLength 1000
|
|
2129
2174
|
*/
|
|
2130
2175
|
objectFieldName?: string;
|
|
@@ -2136,88 +2181,51 @@ export interface ObjectToArray {
|
|
|
2136
2181
|
*/
|
|
2137
2182
|
destinationFieldName?: string;
|
|
2138
2183
|
}
|
|
2139
|
-
/**
|
|
2184
|
+
/** Unwinds an array. */
|
|
2140
2185
|
export interface UnwindArray {
|
|
2141
2186
|
/**
|
|
2142
2187
|
* Key of the array field to unwind.
|
|
2143
2188
|
*
|
|
2144
|
-
* Use dot notation to specify a nested array
|
|
2189
|
+
* Use dot notation to specify a nested array. For example, `user.products` or `product.colors`. 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).
|
|
2145
2190
|
* @maxLength 1000
|
|
2146
2191
|
*/
|
|
2147
2192
|
arrayFieldName?: string;
|
|
2148
2193
|
}
|
|
2149
|
-
export interface
|
|
2194
|
+
export interface AggregationPipeline extends AggregationPipelinePagingMethodOneOf {
|
|
2150
2195
|
/**
|
|
2151
|
-
*
|
|
2152
|
-
*
|
|
2153
|
-
* Groups aggregate data across multiple collection items and create new result items.
|
|
2154
|
-
*/
|
|
2155
|
-
group?: Group;
|
|
2156
|
-
/**
|
|
2157
|
-
* Aggregation filter. Only collection items that match the filter are processed.
|
|
2158
|
-
*
|
|
2159
|
-
* Learn more about [filters in API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language#filters).
|
|
2196
|
+
* Paging options to limit and skip the number of results.
|
|
2160
2197
|
*
|
|
2161
|
-
*
|
|
2198
|
+
* Learn more about [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
|
|
2162
2199
|
*/
|
|
2163
|
-
|
|
2200
|
+
paging?: Paging;
|
|
2164
2201
|
/**
|
|
2165
|
-
*
|
|
2202
|
+
* Cursor token referring to a page of results.
|
|
2166
2203
|
*
|
|
2167
|
-
*
|
|
2204
|
+
* Not used in the first request. Subsequent requests use the cursor token and not `filter` or `sort`.
|
|
2168
2205
|
*/
|
|
2169
|
-
|
|
2170
|
-
/** Transform collection items by including, excluding, or calculating new fields. */
|
|
2171
|
-
projection?: Projection;
|
|
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. */
|
|
2173
|
-
objectToArray?: ObjectToArray;
|
|
2206
|
+
cursorPaging?: CursorPaging;
|
|
2174
2207
|
/**
|
|
2175
|
-
*
|
|
2208
|
+
* Sequence of aggregation operations to apply to the data.
|
|
2176
2209
|
*
|
|
2177
|
-
*
|
|
2210
|
+
* Stages are processed in order, with each stage operating on the output of the previous stage.
|
|
2211
|
+
* @maxSize 100
|
|
2178
2212
|
*/
|
|
2179
|
-
|
|
2180
|
-
/** Number of results to skip from the beginning of the result set. */
|
|
2181
|
-
skip?: number;
|
|
2182
|
-
/** Maximum number of results to return. */
|
|
2183
|
-
limit?: number;
|
|
2213
|
+
stages?: Stage[];
|
|
2184
2214
|
}
|
|
2185
2215
|
/** @oneof */
|
|
2186
|
-
export interface
|
|
2187
|
-
/**
|
|
2188
|
-
* Group.
|
|
2189
|
-
*
|
|
2190
|
-
* Groups aggregate data across multiple collection items and create new result items.
|
|
2191
|
-
*/
|
|
2192
|
-
group?: Group;
|
|
2216
|
+
export interface AggregationPipelinePagingMethodOneOf {
|
|
2193
2217
|
/**
|
|
2194
|
-
*
|
|
2195
|
-
*
|
|
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).
|
|
2199
|
-
*/
|
|
2200
|
-
filter?: Record<string, any> | null;
|
|
2201
|
-
/**
|
|
2202
|
-
* Sorting preferences.
|
|
2218
|
+
* Paging options to limit and skip the number of results.
|
|
2203
2219
|
*
|
|
2204
2220
|
* Learn more about [sorting and paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
|
|
2205
2221
|
*/
|
|
2206
|
-
|
|
2207
|
-
/** Transform collection items by including, excluding, or calculating new fields. */
|
|
2208
|
-
projection?: Projection;
|
|
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. */
|
|
2210
|
-
objectToArray?: ObjectToArray;
|
|
2222
|
+
paging?: Paging;
|
|
2211
2223
|
/**
|
|
2212
|
-
*
|
|
2224
|
+
* Cursor token referring to a page of results.
|
|
2213
2225
|
*
|
|
2214
|
-
*
|
|
2226
|
+
* Not used in the first request. Subsequent requests use the cursor token and not `filter` or `sort`.
|
|
2215
2227
|
*/
|
|
2216
|
-
|
|
2217
|
-
/** Number of results to skip from the beginning of the result set. */
|
|
2218
|
-
skip?: number;
|
|
2219
|
-
/** Maximum number of results to return. */
|
|
2220
|
-
limit?: number;
|
|
2228
|
+
cursorPaging?: CursorPaging;
|
|
2221
2229
|
}
|
|
2222
2230
|
export interface AggregatePipelineDataItemsResponse {
|
|
2223
2231
|
/**
|