@wix/wix-data-items-common 1.0.63 → 1.0.64
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/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/WixDataResult.js.map +1 -1
- package/dist/types/api/WixDataAggregate.d.ts +103 -100
- package/dist/types/api/WixDataAggregate.d.ts.map +1 -1
- package/dist/types/api/WixDataFilter.d.ts +126 -137
- package/dist/types/api/WixDataFilter.d.ts.map +1 -1
- package/dist/types/api/WixDataQuery.d.ts +126 -127
- package/dist/types/api/WixDataQuery.d.ts.map +1 -1
- package/dist/types/api/WixDataResult.d.ts +18 -18
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ export interface WixDataQuery {
|
|
|
9
9
|
/**
|
|
10
10
|
* Adds a sort to a query or sort, sorting by the specified properties in descending order.
|
|
11
11
|
*
|
|
12
|
-
* The `descending()`
|
|
12
|
+
* The `descending()` method refines this query to sort in descending order of the specified properties. If you
|
|
13
13
|
* specify more than one property, descending() sorts the results in descending order by each property in the order
|
|
14
14
|
* they are listed.
|
|
15
15
|
*
|
|
@@ -20,13 +20,13 @@ export interface WixDataQuery {
|
|
|
20
20
|
* - String: Sorts lexicographically, so `"abc"` comes before `"XYZ"`.
|
|
21
21
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
22
22
|
*
|
|
23
|
-
* If a property contains a number as a String, that value
|
|
23
|
+
* If a property contains a number as a String, that value is sorted alphabetically and not numerically. Items
|
|
24
24
|
* that do not have a value for the specified sort property are ranked lowest.
|
|
25
25
|
* @public
|
|
26
26
|
* @documentationMaturity preview
|
|
27
|
-
* @param fields -
|
|
27
|
+
* @param fields - Fields used in the sort.
|
|
28
28
|
* @requiredField fields
|
|
29
|
-
* @returns
|
|
29
|
+
* @returns Refined query.
|
|
30
30
|
*/
|
|
31
31
|
descending(...fields: string[]): WixDataQuery;
|
|
32
32
|
descending(fields: string[]): WixDataQuery;
|
|
@@ -34,7 +34,7 @@ export interface WixDataQuery {
|
|
|
34
34
|
/**
|
|
35
35
|
* Adds a sort to a query or sort, sorting by the specified properties in ascending order.
|
|
36
36
|
*
|
|
37
|
-
* The `ascending()`
|
|
37
|
+
* The `ascending()` method refines this query in ascending order of the specified properties. If you specify more
|
|
38
38
|
* than one property, ascending() sorts the results in ascending order by each property in the order they are listed.
|
|
39
39
|
*
|
|
40
40
|
* You can sort the following types:
|
|
@@ -43,13 +43,13 @@ export interface WixDataQuery {
|
|
|
43
43
|
* - String: Sorts lexicographically, so `"abc"` comes after `"XYZ"`.
|
|
44
44
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
45
45
|
*
|
|
46
|
-
* If a property contains a number as a String, that value
|
|
46
|
+
* If a property contains a number as a String, that value is sorted alphabetically and not numerically.
|
|
47
47
|
* Items that do not have a value for the specified sort property are ranked lowest.
|
|
48
48
|
* @public
|
|
49
49
|
* @documentationMaturity preview
|
|
50
|
-
* @param fields -
|
|
50
|
+
* @param fields - Fields used in the sort.
|
|
51
51
|
* @requiredField fields
|
|
52
|
-
* @returns
|
|
52
|
+
* @returns Refined query.
|
|
53
53
|
*/
|
|
54
54
|
ascending(...fields: string[]): WixDataQuery;
|
|
55
55
|
ascending(fields: string[]): WixDataQuery;
|
|
@@ -57,8 +57,8 @@ export interface WixDataQuery {
|
|
|
57
57
|
/**
|
|
58
58
|
* Refines a query to match items whose specified property value equals the specified value.
|
|
59
59
|
*
|
|
60
|
-
* The `eq()`
|
|
61
|
-
* match items where
|
|
60
|
+
* The `eq()` method refines this query to only
|
|
61
|
+
* match items where Value of the specified property equals the specified `value`.
|
|
62
62
|
*
|
|
63
63
|
* It only matches values of the same type. For example, a number value stored
|
|
64
64
|
* as a String type does not match the same number stored as a Number type.
|
|
@@ -69,17 +69,17 @@ export interface WixDataQuery {
|
|
|
69
69
|
* as long as at least one Array element matches the specified `value`.
|
|
70
70
|
* @public
|
|
71
71
|
* @documentationMaturity preview
|
|
72
|
-
* @param field -
|
|
72
|
+
* @param field - Field whose value is compared with `value`.
|
|
73
73
|
* @requiredField field
|
|
74
|
-
* @param value -
|
|
74
|
+
* @param value - Value to match.
|
|
75
75
|
* @requiredField value
|
|
76
|
-
* @returns
|
|
76
|
+
* @returns Refined query.
|
|
77
77
|
*/
|
|
78
78
|
eq(field: string, value: any): WixDataQuery;
|
|
79
79
|
/**
|
|
80
80
|
* Refines a query to match items whose specified property value does not equal the specified value.
|
|
81
81
|
*
|
|
82
|
-
* The `ne()`
|
|
82
|
+
* The `ne()` method refines this query to only
|
|
83
83
|
* match items where the value of the specified property does not equal the specified `value`.
|
|
84
84
|
*
|
|
85
85
|
* It only matches values of the same type. For example, a number value stored
|
|
@@ -91,25 +91,25 @@ export interface WixDataQuery {
|
|
|
91
91
|
* in which none of the elements of the Array match the specified `value`.
|
|
92
92
|
* @public
|
|
93
93
|
* @documentationMaturity preview
|
|
94
|
-
* @param field -
|
|
94
|
+
* @param field - Field whose value is compared with `value`.
|
|
95
95
|
* @requiredField field
|
|
96
|
-
* @param value -
|
|
96
|
+
* @param value - Value to match.
|
|
97
97
|
* @requiredField value
|
|
98
|
-
* @returns
|
|
98
|
+
* @returns Refined query.
|
|
99
99
|
*/
|
|
100
100
|
ne(field: string, value: any): WixDataQuery;
|
|
101
101
|
/**
|
|
102
102
|
* Refines a query to match items whose specified property value is greater than or equal to the specified
|
|
103
103
|
* value.
|
|
104
104
|
*
|
|
105
|
-
* The `ge()`
|
|
105
|
+
* The `ge()` method refines this query to only
|
|
106
106
|
* match items where the value of the specified property is greater than or
|
|
107
107
|
* equal to the specified `value`.
|
|
108
108
|
*
|
|
109
109
|
* It only matches values of the same type. For example, a number value stored
|
|
110
110
|
* as a String type does not match the same number stored as a Number type.
|
|
111
111
|
*
|
|
112
|
-
* If a property contains a number as a String, that value
|
|
112
|
+
* If a property contains a number as a String, that value is compared
|
|
113
113
|
* alphabetically and not numerically. Items that do not have a value for the
|
|
114
114
|
* specified property are ranked lowest.
|
|
115
115
|
*
|
|
@@ -122,23 +122,23 @@ export interface WixDataQuery {
|
|
|
122
122
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
123
123
|
* @public
|
|
124
124
|
* @documentationMaturity preview
|
|
125
|
-
* @param field -
|
|
125
|
+
* @param field - Field whose value is compared with `value`.
|
|
126
126
|
* @requiredField field
|
|
127
|
-
* @param value -
|
|
127
|
+
* @param value - Value to match.
|
|
128
128
|
* @requiredField value
|
|
129
|
-
* @returns
|
|
129
|
+
* @returns Refined query.
|
|
130
130
|
*/
|
|
131
131
|
ge(field: string, value: Comparable): WixDataQuery;
|
|
132
132
|
/**
|
|
133
133
|
* Refines a query to match items whose specified property value is greater than the specified value.
|
|
134
134
|
*
|
|
135
|
-
* The `gt()`
|
|
135
|
+
* The `gt()` method refines this query to only match
|
|
136
136
|
* items where the value of the specified property is greater than the specified `value`.
|
|
137
137
|
*
|
|
138
138
|
* It only matches values of the same type. For example, a number value stored
|
|
139
139
|
* as a String type does not match the same number stored as a Number type.
|
|
140
140
|
*
|
|
141
|
-
* If a property contains a number as a String, that value
|
|
141
|
+
* If a property contains a number as a String, that value is compared
|
|
142
142
|
* alphabetically and not numerically. Items that do not have a value for the
|
|
143
143
|
* specified property are ranked lowest.
|
|
144
144
|
*
|
|
@@ -149,9 +149,9 @@ export interface WixDataQuery {
|
|
|
149
149
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
150
150
|
* @public
|
|
151
151
|
* @documentationMaturity preview
|
|
152
|
-
* @param field -
|
|
152
|
+
* @param field - Field whose value is compared with `value`.
|
|
153
153
|
* @requiredField field
|
|
154
|
-
* @param value -
|
|
154
|
+
* @param value - Value to match.
|
|
155
155
|
* @requiredField value
|
|
156
156
|
* @returns An object with the query definition, based on the supplied parameters.
|
|
157
157
|
*/
|
|
@@ -160,14 +160,14 @@ export interface WixDataQuery {
|
|
|
160
160
|
* Refines a query to match items whose specified property value is less than or equal to the specified
|
|
161
161
|
* value.
|
|
162
162
|
*
|
|
163
|
-
* The `le()`
|
|
163
|
+
* The `le()` method refines this query to only match
|
|
164
164
|
* items where the value of the specified property is less than or equal to the
|
|
165
165
|
* specified `value`.
|
|
166
166
|
*
|
|
167
167
|
* It only matches values of the same type. For example, a number value stored
|
|
168
168
|
* as a String type does not match the same number stored as a Number type.
|
|
169
169
|
*
|
|
170
|
-
* If a property contains a number as a String, that value
|
|
170
|
+
* If a property contains a number as a String, that value is compared
|
|
171
171
|
* alphabetically and not numerically. Items that do not have a value for the
|
|
172
172
|
* specified property are ranked lowest.
|
|
173
173
|
*
|
|
@@ -180,23 +180,23 @@ export interface WixDataQuery {
|
|
|
180
180
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
181
181
|
* @public
|
|
182
182
|
* @documentationMaturity preview
|
|
183
|
-
* @param field -
|
|
183
|
+
* @param field - Field whose value is compared with `value`.
|
|
184
184
|
* @requiredField field
|
|
185
|
-
* @param value -
|
|
185
|
+
* @param value - Value to match.
|
|
186
186
|
* @requiredField value
|
|
187
|
-
* @returns
|
|
187
|
+
* @returns Refined query.
|
|
188
188
|
*/
|
|
189
189
|
le(field: string, value: Comparable): WixDataQuery;
|
|
190
190
|
/**
|
|
191
191
|
* Refines a query to match items whose specified property value is less than the specified value.
|
|
192
192
|
*
|
|
193
|
-
* The `lt()`
|
|
193
|
+
* The `lt()` method refines this query to only match
|
|
194
194
|
* items where the value of the specified property is less than the specified `value`.
|
|
195
195
|
*
|
|
196
196
|
* It only matches values of the same type. For example, a number value stored
|
|
197
197
|
* as a String type does not match the same number stored as a Number type.
|
|
198
198
|
*
|
|
199
|
-
* If a property contains a number as a String, that value
|
|
199
|
+
* If a property contains a number as a String, that value is compared
|
|
200
200
|
* alphabetically and not numerically. Items that do not have a value for the
|
|
201
201
|
* specified property are ranked lowest.
|
|
202
202
|
*
|
|
@@ -207,9 +207,9 @@ export interface WixDataQuery {
|
|
|
207
207
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
208
208
|
* @public
|
|
209
209
|
* @documentationMaturity preview
|
|
210
|
-
* @param field -
|
|
210
|
+
* @param field - Field whose value is compared with `value`.
|
|
211
211
|
* @requiredField field
|
|
212
|
-
* @param value -
|
|
212
|
+
* @param value - Value to match.
|
|
213
213
|
* @requiredField value
|
|
214
214
|
* @returns An object with the query definition, based on the supplied parameters.
|
|
215
215
|
*/
|
|
@@ -217,22 +217,22 @@ export interface WixDataQuery {
|
|
|
217
217
|
/**
|
|
218
218
|
* Refines a query to match items whose specified property has any value.
|
|
219
219
|
*
|
|
220
|
-
* The `isNotEmpty()`
|
|
220
|
+
* The `isNotEmpty()` method refines this query to only match items where the
|
|
221
221
|
* value of the specified property is not `null` or `undefined`.
|
|
222
222
|
*
|
|
223
223
|
* If the property contains any value at all for a given item, including the
|
|
224
224
|
* empty string or an invalid value, that item will match the query.
|
|
225
225
|
* @public
|
|
226
226
|
* @documentationMaturity preview
|
|
227
|
-
* @param field -
|
|
227
|
+
* @param field - Field in which to check for a value.
|
|
228
228
|
* @requiredField field
|
|
229
|
-
* @returns
|
|
229
|
+
* @returns Refined query.
|
|
230
230
|
*/
|
|
231
231
|
isNotEmpty(field: string): WixDataQuery;
|
|
232
232
|
/**
|
|
233
233
|
* Refines a query to match items whose specified property does not exist or does not have any value.
|
|
234
234
|
*
|
|
235
|
-
* The `isEmpty()`
|
|
235
|
+
* The `isEmpty()` method refines this query to only match items where the
|
|
236
236
|
* value of the specified property is `null` or `undefined` or the property does
|
|
237
237
|
* not exist.
|
|
238
238
|
*
|
|
@@ -240,15 +240,15 @@ export interface WixDataQuery {
|
|
|
240
240
|
* empty string or an invalid value, that item will match the query.
|
|
241
241
|
* @public
|
|
242
242
|
* @documentationMaturity preview
|
|
243
|
-
* @param field -
|
|
243
|
+
* @param field - Field in which to check for a value.
|
|
244
244
|
* @requiredField field
|
|
245
|
-
* @returns
|
|
245
|
+
* @returns Refined query.
|
|
246
246
|
*/
|
|
247
247
|
isEmpty(field: string): WixDataQuery;
|
|
248
248
|
/**
|
|
249
249
|
* Refines a query to match items whose specified property value starts with a specified string.
|
|
250
250
|
*
|
|
251
|
-
* The `startsWith()`
|
|
251
|
+
* The `startsWith()` method refines this query to
|
|
252
252
|
* only match items where the value of the specified property starts with the
|
|
253
253
|
* defined `string`. Matching with `startsWith()` is not case sensitive, so `"TEXT"` starts
|
|
254
254
|
* with `"tex"`.
|
|
@@ -257,7 +257,7 @@ export interface WixDataQuery {
|
|
|
257
257
|
* When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.
|
|
258
258
|
* @public
|
|
259
259
|
* @documentationMaturity preview
|
|
260
|
-
* @param field -
|
|
260
|
+
* @param field - Field whose value is compared with the `value` parameter.
|
|
261
261
|
* @requiredField field
|
|
262
262
|
* @param value - The string to look for at the beginning of the specified property value.
|
|
263
263
|
* @requiredField value
|
|
@@ -267,7 +267,7 @@ export interface WixDataQuery {
|
|
|
267
267
|
/**
|
|
268
268
|
* Refines a query to match items whose specified property value ends with a specified string.
|
|
269
269
|
*
|
|
270
|
-
* The `endsWith()`
|
|
270
|
+
* The `endsWith()` method refines this query to only
|
|
271
271
|
* match items where the value of the specified property ends with the specified
|
|
272
272
|
* `string`. Matching with `endsWith()` is not case sensitive, so `"TEXT"` ends
|
|
273
273
|
* with `"ext"`.
|
|
@@ -276,7 +276,7 @@ export interface WixDataQuery {
|
|
|
276
276
|
* When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.
|
|
277
277
|
* @public
|
|
278
278
|
* @documentationMaturity preview
|
|
279
|
-
* @param field -
|
|
279
|
+
* @param field - Field whose value is compared with the string.
|
|
280
280
|
* @requiredField field
|
|
281
281
|
* @param value - The string to look for at the end of the specified property value.
|
|
282
282
|
* @requiredField value
|
|
@@ -286,29 +286,29 @@ export interface WixDataQuery {
|
|
|
286
286
|
/**
|
|
287
287
|
* Refines a query to match items whose specified property value contains a specified string.
|
|
288
288
|
*
|
|
289
|
-
* The `contains()`
|
|
289
|
+
* The `contains()` method refines this query to
|
|
290
290
|
* only match items where the value of the specified property contains the
|
|
291
291
|
* specified `string`. Matching with `contains()` is not case sensitive, so
|
|
292
292
|
* `"text"` does contain `"Tex"`.
|
|
293
293
|
*
|
|
294
294
|
* You can use `contains()` with a property whose value is a String or a Reference.
|
|
295
295
|
* For properties of type reference it is recommended that you use the [`eq()`](#eq)
|
|
296
|
-
*
|
|
296
|
+
* method instead of `contains()`. With properties that are References, `contains()`
|
|
297
297
|
* matches by the ID of the referenced item as a String.
|
|
298
298
|
* @public
|
|
299
299
|
* @documentationMaturity preview
|
|
300
|
-
* @param field -
|
|
300
|
+
* @param field - Field whose value is compared with the string.
|
|
301
301
|
* @requiredField field
|
|
302
302
|
* @param value - The string to look for inside the specified property value.
|
|
303
303
|
* @requiredField value
|
|
304
|
-
* @returns
|
|
304
|
+
* @returns Refined query.
|
|
305
305
|
*/
|
|
306
306
|
contains(field: string, value: string): WixDataQuery;
|
|
307
307
|
/**
|
|
308
308
|
* Refines a query to match items whose specified property value equals any of the specified `values`
|
|
309
309
|
* parameters.
|
|
310
310
|
*
|
|
311
|
-
* The `hasSome()`
|
|
311
|
+
* The `hasSome()` method refines this query to
|
|
312
312
|
* only match items where the value of the specified property equals any of
|
|
313
313
|
* the specified values.
|
|
314
314
|
*
|
|
@@ -325,11 +325,11 @@ export interface WixDataQuery {
|
|
|
325
325
|
* String, Number, or Date types as the `value` parameters.
|
|
326
326
|
* @public
|
|
327
327
|
* @documentationMaturity preview
|
|
328
|
-
* @param field -
|
|
328
|
+
* @param field - Field whose value is compared with `value`.
|
|
329
329
|
* @requiredField field
|
|
330
|
-
* @param values -
|
|
330
|
+
* @param values - Values to match.
|
|
331
331
|
* @requiredField values
|
|
332
|
-
* @returns
|
|
332
|
+
* @returns Refined query.
|
|
333
333
|
*/
|
|
334
334
|
hasSome(field: string, ...values: Comparable[]): WixDataQuery;
|
|
335
335
|
/**
|
|
@@ -342,7 +342,7 @@ export interface WixDataQuery {
|
|
|
342
342
|
* Refines a query to match items whose specified property values equals all of the specified `value`
|
|
343
343
|
* parameters.
|
|
344
344
|
*
|
|
345
|
-
* The `hasAll()`
|
|
345
|
+
* The `hasAll()` method refines this query to
|
|
346
346
|
* only match items where the value of the specified property equals all of
|
|
347
347
|
* the specified values.
|
|
348
348
|
*
|
|
@@ -356,11 +356,11 @@ export interface WixDataQuery {
|
|
|
356
356
|
* String, Number, or Date types as the `value` parameters.
|
|
357
357
|
* @public
|
|
358
358
|
* @documentationMaturity preview
|
|
359
|
-
* @param field -
|
|
359
|
+
* @param field - Field whose value is compared with `value`.
|
|
360
360
|
* @requiredField field
|
|
361
|
-
* @param values -
|
|
361
|
+
* @param values - Values to match.
|
|
362
362
|
* @requiredField values
|
|
363
|
-
* @returns
|
|
363
|
+
* @returns Refined query.
|
|
364
364
|
*/
|
|
365
365
|
hasAll(field: string, ...values: Comparable[]): WixDataQuery;
|
|
366
366
|
/**
|
|
@@ -372,35 +372,35 @@ export interface WixDataQuery {
|
|
|
372
372
|
/**
|
|
373
373
|
* Adds an `or` condition to the query or filter.
|
|
374
374
|
*
|
|
375
|
-
* The `or()`
|
|
375
|
+
* The `or()` method adds an inclusive `or` condition to this filter. A query or filter
|
|
376
376
|
* with an `or` returns all the items that match the query or filter as defined up to
|
|
377
|
-
* the `or`
|
|
378
|
-
*
|
|
377
|
+
* the `or` method, the items that match the query or filter passed to the `or`
|
|
378
|
+
* method, and the items that match both.
|
|
379
379
|
*
|
|
380
|
-
* The 'or()'
|
|
380
|
+
* The 'or()' method is designed to work with 2 or more queries or filters.
|
|
381
381
|
* If you use it on its own, it will return all the items in a collection.
|
|
382
382
|
* @public
|
|
383
383
|
* @documentationMaturity preview
|
|
384
|
-
* @param filter -
|
|
384
|
+
* @param filter - Filter to add to the initial filter as an `or` condition.
|
|
385
385
|
* @requiredField filter
|
|
386
|
-
* @returns
|
|
386
|
+
* @returns Refined query.
|
|
387
387
|
*/
|
|
388
388
|
or(filter: WixDataFilter): WixDataQuery;
|
|
389
389
|
/**
|
|
390
390
|
* Adds an `and` condition to the query or filter.
|
|
391
391
|
*
|
|
392
|
-
* The `and()`
|
|
393
|
-
* that match the query or filter as defined up to the `and`
|
|
394
|
-
* the `and`
|
|
392
|
+
* The `and()` method adds an and condition to this query. A query or filter with an `and` returns all the items
|
|
393
|
+
* that match the query or filter as defined up to the `and` method and also match the query or filter passed to
|
|
394
|
+
* the `and` method.
|
|
395
395
|
*
|
|
396
|
-
* Note that when chaining multiple `WixDataFilter`
|
|
397
|
-
* you do not need to add a call to the `and()`
|
|
396
|
+
* Note that when chaining multiple `WixDataFilter` methods to a query an and condition is assumed. In such cases,
|
|
397
|
+
* you do not need to add a call to the `and()` method. For example, this query returns results where status is
|
|
398
398
|
* active **and** age is greater than 25.
|
|
399
399
|
* ```js
|
|
400
400
|
* wixClient.items.query("myCollection").eq("status", "active").gt("age", 25);
|
|
401
401
|
* ```
|
|
402
402
|
*
|
|
403
|
-
* The `and()`
|
|
403
|
+
* The `and()` method is needed when performing compound queries. For example, the final query in this set of
|
|
404
404
|
* queries returns results where status is either pending or rejected **and** age is either less than 25 or greater
|
|
405
405
|
* than 65.
|
|
406
406
|
* ```js
|
|
@@ -417,42 +417,41 @@ export interface WixDataQuery {
|
|
|
417
417
|
* let statusAndAgeQuery = statusQuery.and(ageQuery);
|
|
418
418
|
* ```
|
|
419
419
|
*
|
|
420
|
-
* The `and()`
|
|
421
|
-
* return all the items in a collection.
|
|
420
|
+
* The `and()` method is designed to work with 2 or more queries or filters. When used on its own, it returns all the items in a collection.
|
|
422
421
|
* @public
|
|
423
422
|
* @documentationMaturity preview
|
|
424
|
-
* @param filter -
|
|
423
|
+
* @param filter - Filter to add to the initial query as an `and` condition.
|
|
425
424
|
* @requiredField filter
|
|
426
|
-
* @returns
|
|
425
|
+
* @returns Refined query.
|
|
427
426
|
*/
|
|
428
427
|
and(filter: WixDataFilter): WixDataQuery;
|
|
429
428
|
/**
|
|
430
429
|
* Adds a `not` condition to the query or filter.
|
|
431
430
|
*
|
|
432
|
-
* The `not()`
|
|
431
|
+
* The `not()` method adds a `not` condition to this query. A query with a `not`
|
|
433
432
|
* returns all the items that match the query as defined up to the `not`
|
|
434
|
-
*
|
|
433
|
+
* method, but don't match the filter passed to the `not` method.
|
|
435
434
|
*
|
|
436
|
-
* If the query only contains a `not()`
|
|
435
|
+
* If the query only contains a `not()` method, it returns all the items
|
|
437
436
|
* that don't match the filter defined by the `not` method.
|
|
438
437
|
*
|
|
439
438
|
* @public
|
|
440
439
|
* @documentationMaturity preview
|
|
441
|
-
* @param filter -
|
|
440
|
+
* @param filter - Filter to add to the initial filter as a `not` condition.
|
|
442
441
|
* @requiredField filter
|
|
443
|
-
* @returns
|
|
442
|
+
* @returns Refined query.
|
|
444
443
|
*/
|
|
445
444
|
not(filter: WixDataFilter): WixDataQuery;
|
|
446
445
|
/**
|
|
447
446
|
* Refines a query to match items whose specified property value is within a specified range.
|
|
448
447
|
*
|
|
449
|
-
* The `between()`
|
|
448
|
+
* The `between()` method refines this query to only match items where the value of the specified property is
|
|
450
449
|
* greater than or equal to `rangeStart` and less than `rangeEnd`.
|
|
451
450
|
*
|
|
452
451
|
* It only matches values of the same type. For example, a number value stored as a String type does not match the
|
|
453
452
|
* same number stored as a Number type.
|
|
454
453
|
*
|
|
455
|
-
* If a property contains a number as a String, that value
|
|
454
|
+
* If a property contains a number as a String, that value is compared alphabetically and not numerically. Items
|
|
456
455
|
* that do not have a value for the specified property are ranked lowest.
|
|
457
456
|
*
|
|
458
457
|
* The following types of properties can be compared:
|
|
@@ -463,46 +462,46 @@ export interface WixDataQuery {
|
|
|
463
462
|
* - `"A"`, `"M"`, `"Z"`, and `"a"` are between `"A"` and `"z"`, but `"z"` is not.
|
|
464
463
|
* @public
|
|
465
464
|
* @documentationMaturity preview
|
|
466
|
-
* @param field -
|
|
465
|
+
* @param field - Field whose value is compared with rangeStart and rangeEnd.
|
|
467
466
|
* @requiredField field
|
|
468
|
-
* @param rangeStart -
|
|
467
|
+
* @param rangeStart - Starting value of the range to match.
|
|
469
468
|
* @requiredField rangeStart
|
|
470
|
-
* @param rangeEnd -
|
|
469
|
+
* @param rangeEnd - Ending value of the range to match.
|
|
471
470
|
* @requiredField rangeEnd
|
|
472
|
-
* @returns
|
|
471
|
+
* @returns Refined query.
|
|
473
472
|
*/
|
|
474
473
|
between<T extends Comparable>(field: string, rangeStart: T, rangeEnd: T): WixDataQuery;
|
|
475
474
|
/**
|
|
476
475
|
* Returns the number of items that match the query.
|
|
477
476
|
*
|
|
478
|
-
* The `count()`
|
|
477
|
+
* The `count()` method returns a Promise that resolves to the number of
|
|
479
478
|
* items that match the query. The Promise is rejected if `count()` is called
|
|
480
|
-
* with incorrect permissions or if any of the
|
|
479
|
+
* with incorrect permissions or if any of the methods used to refine the
|
|
481
480
|
* query is invalid.
|
|
482
481
|
*
|
|
483
|
-
* Calling the `count()`
|
|
482
|
+
* Calling the `count()` method triggers the `beforeCount()` and `afterCount()` hooks if they have been defined.
|
|
484
483
|
*
|
|
485
484
|
* Use the `options` parameter to run `count()` without checking for permissions
|
|
486
485
|
* or without its registered hooks.
|
|
487
486
|
*
|
|
488
|
-
* Any
|
|
487
|
+
* Any method that does not filter query results (e.g., [`ascending()`](#ascending))
|
|
489
488
|
* does not affect the result of `count()`.
|
|
490
489
|
*
|
|
491
|
-
* If you build a query and don't refine it with any `WixDataQuery`
|
|
490
|
+
* If you build a query and don't refine it with any `WixDataQuery` methods,
|
|
492
491
|
* `count()` returns the total number of items in the collection.
|
|
493
492
|
*
|
|
494
|
-
*
|
|
495
|
-
*
|
|
493
|
+
* > **Note**: You can also retrieve the number of query results by calling `find()` and setting the `returnTotalCount` property to `true`.
|
|
494
|
+
*
|
|
496
495
|
* @public
|
|
497
496
|
* @documentationMaturity preview
|
|
498
|
-
* @param options -
|
|
499
|
-
* @returns
|
|
497
|
+
* @param options - Options to use when processing this operation.
|
|
498
|
+
* @returns Number of items that match the query.
|
|
500
499
|
*/
|
|
501
500
|
count(options?: WixDataReadOptions): Promise<number>;
|
|
502
501
|
/**
|
|
503
502
|
* Returns the distinct values that match the query, without duplicates.
|
|
504
503
|
*
|
|
505
|
-
* The `distinct()`
|
|
504
|
+
* The `distinct()` method returns a Promise that resolves to:
|
|
506
505
|
* - The distinct values found in the specified field when running the query.
|
|
507
506
|
* - Additional information about the results, such as the number of values that match the query.
|
|
508
507
|
*
|
|
@@ -513,14 +512,14 @@ export interface WixDataQuery {
|
|
|
513
512
|
* the collection are not evaluated when resolving the promise.
|
|
514
513
|
*
|
|
515
514
|
* The Promise is rejected if `distinct()` is called with incorrect permissions or if any of the
|
|
516
|
-
*
|
|
515
|
+
* methods used to refine the query is invalid.
|
|
517
516
|
*
|
|
518
517
|
* >**Note:** Only site visitors with [Data Read](https://support.wix.com/en/article/collection-permissions-an-overview#permissions)
|
|
519
518
|
* permissions can retrieve and view data. You can override the permissions in backend code by setting the
|
|
520
519
|
* `suppressAuth` option to `true`.
|
|
521
520
|
* @public
|
|
522
521
|
* @documentationMaturity preview
|
|
523
|
-
* @param field -
|
|
522
|
+
* @param field - Field whose value is compared for distinct values.
|
|
524
523
|
* @requiredField field
|
|
525
524
|
* @param options - An object containing options to use when processing this operation.
|
|
526
525
|
* @returns A Promise that resolves to the results of the query.
|
|
@@ -529,12 +528,12 @@ export interface WixDataQuery {
|
|
|
529
528
|
/**
|
|
530
529
|
* Returns the items that match the query.
|
|
531
530
|
*
|
|
532
|
-
* The `find()`
|
|
531
|
+
* The `find()` method returns a Promise that resolves to the results found
|
|
533
532
|
* by the query and some information about the results. The Promise is
|
|
534
533
|
* rejected if `find()` is called with incorrect permissions or if any of the
|
|
535
|
-
*
|
|
534
|
+
* methods used to refine the query is invalid.
|
|
536
535
|
*
|
|
537
|
-
* Calling the `find()`
|
|
536
|
+
* Calling the `find()` method triggers the `beforeQuery()` and `afterQuery()` hooks if they have been defined.
|
|
538
537
|
*
|
|
539
538
|
* > **Note:**
|
|
540
539
|
* > Calling `find()` triggers hooks for the specified collection only. It doesn't trigger hooks for referenced
|
|
@@ -546,18 +545,18 @@ export interface WixDataQuery {
|
|
|
546
545
|
* - Prevent hooks from running with `suppressHooks`.
|
|
547
546
|
* - Speed up execution with `omitTotalCount`, if you don't need a count of items matching the query.
|
|
548
547
|
*
|
|
549
|
-
* If you build a query and don't refine it with any `wixDataQuery`
|
|
548
|
+
* If you build a query and don't refine it with any `wixDataQuery` methods,
|
|
550
549
|
* `find()` returns the entire collection.
|
|
551
550
|
* @public
|
|
552
551
|
* @documentationMaturity preview
|
|
553
|
-
* @param options -
|
|
554
|
-
* @returns
|
|
552
|
+
* @param options - Options to use when processing this operation.
|
|
553
|
+
* @returns Promise that resolves to the results of the query.
|
|
555
554
|
*/
|
|
556
555
|
find(options?: WixDataQueryOptions): Promise<WixDataResult>;
|
|
557
556
|
/**
|
|
558
557
|
* Lists the fields to return in a query's results.
|
|
559
558
|
*
|
|
560
|
-
* The `fields()`
|
|
559
|
+
* The `fields()` method returns only the specified fields in the query's results.
|
|
561
560
|
*
|
|
562
561
|
* You can use `include()` in conjunction with `fields()` to get referenced items.
|
|
563
562
|
*
|
|
@@ -575,9 +574,9 @@ export interface WixDataQuery {
|
|
|
575
574
|
/**
|
|
576
575
|
* Limits the number of items the query returns.
|
|
577
576
|
*
|
|
578
|
-
* The `limit()`
|
|
577
|
+
* The `limit()` method defines the number of results a query returns in each
|
|
579
578
|
* page. Only one page of results is retrieved at a time. The `next()`
|
|
580
|
-
* and `prev()`
|
|
579
|
+
* and `prev()` methods are used to
|
|
581
580
|
* navigate the pages of a query result.
|
|
582
581
|
*
|
|
583
582
|
* By default, `limit` is set to `50`.
|
|
@@ -588,15 +587,15 @@ export interface WixDataQuery {
|
|
|
588
587
|
* less than `1000`. For example, the maximum limit for the Wix `Stores/Product` collection is 100.
|
|
589
588
|
* @public
|
|
590
589
|
* @documentationMaturity preview
|
|
591
|
-
* @param limitNumber -
|
|
590
|
+
* @param limitNumber - Number of items to return, which is also the `pageSize` of the results object.
|
|
592
591
|
* @requiredField limitNumber
|
|
593
|
-
* @returns
|
|
592
|
+
* @returns `WixDataQuery` object representing the refined query.
|
|
594
593
|
*/
|
|
595
594
|
limit(limitNumber: number): WixDataQuery;
|
|
596
595
|
/**
|
|
597
596
|
* Sets the number of items to skip before returning query results.
|
|
598
597
|
*
|
|
599
|
-
* The `skip()`
|
|
598
|
+
* The `skip()` method defines the number of results to skip in the query
|
|
600
599
|
* results before returning new query results.
|
|
601
600
|
*
|
|
602
601
|
* For example, if you query a collection and 50 items match your query, but
|
|
@@ -606,15 +605,15 @@ export interface WixDataQuery {
|
|
|
606
605
|
* By default, `skip` is set to 0.
|
|
607
606
|
* @public
|
|
608
607
|
* @documentationMaturity preview
|
|
609
|
-
* @param
|
|
610
|
-
* @requiredField
|
|
611
|
-
* @returns
|
|
608
|
+
* @param skipCount - Number of items to skip in the query results before returning the results.
|
|
609
|
+
* @requiredField skipCount
|
|
610
|
+
* @returns `WixDataQuery` object representing the refined query.
|
|
612
611
|
*/
|
|
613
|
-
skip(
|
|
612
|
+
skip(skipCount: number): WixDataQuery;
|
|
614
613
|
/**
|
|
615
614
|
* Includes referenced items for the specified properties in a query's results.
|
|
616
615
|
*
|
|
617
|
-
* The `include()`
|
|
616
|
+
* The `include()` method refines a query so that the items returned in the
|
|
618
617
|
* query's results include the full referenced items for the specified properties.
|
|
619
618
|
*
|
|
620
619
|
* For example, suppose you have a **books** collection with an **author**
|
|
@@ -624,7 +623,7 @@ export interface WixDataQuery {
|
|
|
624
623
|
* `author` property.
|
|
625
624
|
*
|
|
626
625
|
* When querying a collection that contains a reference field without using the
|
|
627
|
-
* `include()`
|
|
626
|
+
* `include()` method:
|
|
628
627
|
* - Single reference field: returned items contain only the ID of the
|
|
629
628
|
* referenced item, and not the full referenced items.
|
|
630
629
|
* - Multiple reference field: returned items do not contain the multiple
|
|
@@ -634,57 +633,57 @@ export interface WixDataQuery {
|
|
|
634
633
|
* apply:
|
|
635
634
|
* - Only one property with multiple references can be included.
|
|
636
635
|
* - The query will return an error if more than 50 items are returned, regardless
|
|
637
|
-
* of any query limit set using the `limit()`
|
|
636
|
+
* of any query limit set using the `limit()` method.
|
|
638
637
|
* - Each returned item can include up to 50 referenced items. If there are more
|
|
639
638
|
* than 50 referenced items, only 50 are returned when the query is run
|
|
640
639
|
* and the `partialIncludes`
|
|
641
640
|
* property of the returned `WixDataQueryResult`
|
|
642
641
|
* is `true`. To retrieve more than 50 referenced items, use the
|
|
643
|
-
* `queryReferenced()`
|
|
642
|
+
* `queryReferenced()` method.
|
|
644
643
|
*
|
|
645
644
|
* For a discussion of when to use the similar `queryReferenced()`
|
|
646
|
-
*
|
|
645
|
+
* method and when to use `include()`, see [Querying Items that Reference Other Items](https://support.wix.com/en/article/including-referenced-data-when-filtering).
|
|
647
646
|
*
|
|
648
647
|
* > **Notes:**
|
|
649
|
-
* > - Calling the `include()`
|
|
650
|
-
* > - The `include()`
|
|
648
|
+
* > - Calling the `include()` method does not trigger any hooks.
|
|
649
|
+
* > - The `include()` method is not supported for Single Item Collections.
|
|
651
650
|
* @public
|
|
652
651
|
* @documentationMaturity preview
|
|
653
|
-
* @param
|
|
654
|
-
* @requiredField
|
|
652
|
+
* @param fields - Fields for which to include referenced items.
|
|
653
|
+
* @requiredField fields
|
|
655
654
|
* @returns A `WixDataQuery` object representing the query.
|
|
656
655
|
*/
|
|
657
|
-
include(...
|
|
656
|
+
include(...fields: string[]): WixDataQuery;
|
|
658
657
|
/**
|
|
659
658
|
* Overload for `include()`
|
|
660
659
|
* @public
|
|
661
660
|
* @documentationMaturity preview
|
|
662
661
|
*/
|
|
663
|
-
include(
|
|
662
|
+
include(field: string, limit?: number): WixDataQuery;
|
|
664
663
|
/**
|
|
665
664
|
* Overload for `include()`
|
|
666
665
|
* @public
|
|
667
666
|
* @documentationMaturity preview
|
|
668
667
|
*/
|
|
669
|
-
include(
|
|
668
|
+
include(field1: string, field2: string, limit?: number): WixDataQuery;
|
|
670
669
|
/**
|
|
671
670
|
* Overload for `include()`
|
|
672
671
|
* @public
|
|
673
672
|
* @documentationMaturity preview
|
|
674
673
|
*/
|
|
675
|
-
include(
|
|
674
|
+
include(field1: string, field2: string, field3: string, limit?: number): WixDataQuery;
|
|
676
675
|
/**
|
|
677
676
|
* Overload for `include()`
|
|
678
677
|
* @public
|
|
679
678
|
* @documentationMaturity preview
|
|
680
679
|
*/
|
|
681
|
-
include(
|
|
680
|
+
include(field1: string, field2: string, field3: string, field4: string, limit?: number): WixDataQuery;
|
|
682
681
|
/**
|
|
683
682
|
* Overload for `include()`
|
|
684
683
|
* @public
|
|
685
684
|
* @documentationMaturity preview
|
|
686
685
|
*/
|
|
687
|
-
include(
|
|
686
|
+
include(field1: string, field2: string, field3: string, field4: string, field5: string, limit?: number): WixDataQuery;
|
|
688
687
|
/**
|
|
689
688
|
* Overload for `include()`
|
|
690
689
|
* @public
|