@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
|
@@ -4,10 +4,10 @@ type Comparable = string | number | Date;
|
|
|
4
4
|
*/
|
|
5
5
|
export interface WixDataFilter {
|
|
6
6
|
/**
|
|
7
|
-
* Refines a filter to match items whose specified
|
|
7
|
+
* Refines a filter to match items whose specified field value equals the specified value.
|
|
8
8
|
*
|
|
9
|
-
* The `eq()`
|
|
10
|
-
* match items where the value of the specified
|
|
9
|
+
* The `eq()` method refines this filter to only
|
|
10
|
+
* match items where the value of the specified field equals the specified `value`.
|
|
11
11
|
*
|
|
12
12
|
* It only matches values of the same type. For example, a number value stored
|
|
13
13
|
* as a String type does not match the same number stored as a Number type.
|
|
@@ -18,51 +18,51 @@ export interface WixDataFilter {
|
|
|
18
18
|
* as long as at least one Array element matches the specified `value`.
|
|
19
19
|
* @public
|
|
20
20
|
* @documentationMaturity preview
|
|
21
|
-
* @param field -
|
|
21
|
+
* @param field - field whose value is compared with `value`.
|
|
22
22
|
* @requiredField field
|
|
23
|
-
* @param value -
|
|
23
|
+
* @param value - Value to compare with.
|
|
24
24
|
* @requiredField value
|
|
25
|
-
* @returns
|
|
25
|
+
* @returns Refined filter.
|
|
26
26
|
*/
|
|
27
27
|
eq(field: string, value: any): WixDataFilter;
|
|
28
28
|
/**
|
|
29
|
-
* Refines a filter to match items whose specified
|
|
29
|
+
* Refines a filter to match items whose specified field value does not equal the specified value.
|
|
30
30
|
*
|
|
31
|
-
* The `ne()`
|
|
32
|
-
* match items where the value of the specified
|
|
31
|
+
* The `ne()` method refines this filter to only
|
|
32
|
+
* match items where the value of the specified field does not equal the specified `value`.
|
|
33
33
|
*
|
|
34
34
|
* It only matches values of the same type. For example, a number value stored
|
|
35
35
|
* as a String type is considered not equal to the same number stored as a Number type.
|
|
36
36
|
*
|
|
37
37
|
* Matching strings with `ne()` is case sensitive, so `"text"` is not equal to `"Text"`.
|
|
38
38
|
*
|
|
39
|
-
* If the value of
|
|
39
|
+
* If the value of `field` is an array, `ne()` includes items
|
|
40
40
|
* in which none of the elements of the Array match the specified `value`.
|
|
41
41
|
* @public
|
|
42
42
|
* @documentationMaturity preview
|
|
43
|
-
* @param field -
|
|
43
|
+
* @param field - Field whose value is compared with `value`.
|
|
44
44
|
* @requiredField field
|
|
45
|
-
* @param value -
|
|
45
|
+
* @param value - Value to match.
|
|
46
46
|
* @requiredField value
|
|
47
|
-
* @returns
|
|
47
|
+
* @returns Refined filter.
|
|
48
48
|
*/
|
|
49
49
|
ne(field: string, value: any): WixDataFilter;
|
|
50
50
|
/**
|
|
51
|
-
* Refines a filter to match items whose specified
|
|
51
|
+
* Refines a filter to match items whose specified field value is greater than or equal to the specified
|
|
52
52
|
* value.
|
|
53
53
|
*
|
|
54
|
-
* The `ge()`
|
|
55
|
-
* match items where the value of the specified
|
|
54
|
+
* The `ge()` method refines this filter to only
|
|
55
|
+
* match items where the value of the specified field is greater than or
|
|
56
56
|
* equal to the specified `value`.
|
|
57
57
|
*
|
|
58
58
|
* It only matches values of the same type. For example, a number value stored
|
|
59
59
|
* as a String type does not match the same number stored as a Number type.
|
|
60
60
|
*
|
|
61
|
-
* If a
|
|
61
|
+
* If a field contains a number as a String, that value is compared
|
|
62
62
|
* alphabetically and not numerically. Items that do not have a value for the
|
|
63
|
-
* specified
|
|
63
|
+
* specified field are ranked lowest.
|
|
64
64
|
*
|
|
65
|
-
* The following types
|
|
65
|
+
* The following field types can be compared:
|
|
66
66
|
* - Number: Compares numerically.
|
|
67
67
|
* - Date: Compares JavaScript Date objects.
|
|
68
68
|
* - String: Compares lexicographically,
|
|
@@ -71,56 +71,56 @@ export interface WixDataFilter {
|
|
|
71
71
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
72
72
|
* @public
|
|
73
73
|
* @documentationMaturity preview
|
|
74
|
-
* @param field -
|
|
74
|
+
* @param field - Field whose value is compared with `value`.
|
|
75
75
|
* @requiredField field
|
|
76
|
-
* @param value -
|
|
76
|
+
* @param value - Value to match.
|
|
77
77
|
* @requiredField value
|
|
78
|
-
* @returns
|
|
78
|
+
* @returns Refined filter.
|
|
79
79
|
*/
|
|
80
80
|
ge(field: string, value: Comparable): WixDataFilter;
|
|
81
81
|
/**
|
|
82
|
-
* Refines a filter to match items whose specified
|
|
82
|
+
* Refines a filter to match items whose specified field value is greater than the specified value.
|
|
83
83
|
*
|
|
84
|
-
* The `gt()`
|
|
85
|
-
* items where the value of the specified
|
|
84
|
+
* The `gt()` method refines this filter to only match
|
|
85
|
+
* items where the value of the specified field is greater than the specified `value`.
|
|
86
86
|
*
|
|
87
87
|
* It only matches values of the same type. For example, a number value stored
|
|
88
88
|
* as a String type does not match the same number stored as a Number type.
|
|
89
89
|
*
|
|
90
|
-
* If a
|
|
90
|
+
* If a field contains a number as a String, that value is compared
|
|
91
91
|
* alphabetically and not numerically. Items that do not have a value for the
|
|
92
|
-
* specified
|
|
92
|
+
* specified field are ranked lowest.
|
|
93
93
|
*
|
|
94
|
-
* The following types
|
|
94
|
+
* The following field types can be compared:
|
|
95
95
|
* - Number: Compares numerically.
|
|
96
96
|
* - Date: Compares JavaScript Date objects.
|
|
97
97
|
* - String: Compares lexicographically, so `"text"` is greater than `"Text"`.
|
|
98
98
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
99
99
|
* @public
|
|
100
100
|
* @documentationMaturity preview
|
|
101
|
-
* @param field -
|
|
101
|
+
* @param field - Field whose value is compared with `value`.
|
|
102
102
|
* @requiredField field
|
|
103
|
-
* @param value -
|
|
103
|
+
* @param value - Value to match.
|
|
104
104
|
* @requiredField value
|
|
105
105
|
* @returns An object with the filter definition, based on the supplied parameters.
|
|
106
106
|
*/
|
|
107
107
|
gt(field: string, value: Comparable): WixDataFilter;
|
|
108
108
|
/**
|
|
109
|
-
* Refines a filter to match items whose specified
|
|
109
|
+
* Refines a filter to match items whose specified field value is less than or equal to the specified
|
|
110
110
|
* value.
|
|
111
111
|
*
|
|
112
|
-
* The `le()`
|
|
113
|
-
* items where the value of the specified
|
|
112
|
+
* The `le()` method refines this filter to only match
|
|
113
|
+
* items where the value of the specified field is less than or equal to the
|
|
114
114
|
* specified `value`.
|
|
115
115
|
*
|
|
116
116
|
* It only matches values of the same type. For example, a number value stored
|
|
117
117
|
* as a String type does not match the same number stored as a Number type.
|
|
118
118
|
*
|
|
119
|
-
* If a
|
|
119
|
+
* If a field contains a number as a String, that value is compared
|
|
120
120
|
* alphabetically and not numerically. Items that do not have a value for the
|
|
121
|
-
* specified
|
|
121
|
+
* specified field are ranked lowest.
|
|
122
122
|
*
|
|
123
|
-
* The following types
|
|
123
|
+
* The following field types can be compared:
|
|
124
124
|
* - Number: Compares numerically.
|
|
125
125
|
* - Date: Compares JavaScript Date objects.
|
|
126
126
|
* - String: Compares lexicographically,
|
|
@@ -129,154 +129,148 @@ export interface WixDataFilter {
|
|
|
129
129
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
130
130
|
* @public
|
|
131
131
|
* @documentationMaturity preview
|
|
132
|
-
* @param field -
|
|
132
|
+
* @param field - Field whose value is compared with `value`.
|
|
133
133
|
* @requiredField field
|
|
134
|
-
* @param value -
|
|
134
|
+
* @param value - Value to match.
|
|
135
135
|
* @requiredField value
|
|
136
|
-
* @returns
|
|
136
|
+
* @returns Refined filter.
|
|
137
137
|
*/
|
|
138
138
|
le(field: string, value: Comparable): WixDataFilter;
|
|
139
139
|
/**
|
|
140
|
-
* Refines a filter to match items whose specified
|
|
140
|
+
* Refines a filter to match items whose specified field value is less than the specified value.
|
|
141
141
|
*
|
|
142
|
-
* The `lt()`
|
|
143
|
-
* items where the value of the specified
|
|
142
|
+
* The `lt()` method refines this filter to only match
|
|
143
|
+
* items where the value of the specified field is less than the specified `value`.
|
|
144
144
|
*
|
|
145
145
|
* It only matches values of the same type. For example, a number value stored
|
|
146
146
|
* as a String type does not match the same number stored as a Number type.
|
|
147
147
|
*
|
|
148
|
-
* If a
|
|
148
|
+
* If a field contains a number as a String, that value is compared
|
|
149
149
|
* alphabetically and not numerically. Items that do not have a value for the
|
|
150
|
-
* specified
|
|
150
|
+
* specified field are ranked lowest.
|
|
151
151
|
*
|
|
152
|
-
* The following types
|
|
152
|
+
* The following field types can be compared:
|
|
153
153
|
* - Number: Compares numerically.
|
|
154
154
|
* - Date: Compares JavaScript Date objects.
|
|
155
155
|
* - String: Compares lexicographically, so `"Text"` is less than `"text"`.
|
|
156
156
|
* - Reference: Compares by the ID of the referenced item as a String.
|
|
157
157
|
* @public
|
|
158
158
|
* @documentationMaturity preview
|
|
159
|
-
* @param field -
|
|
159
|
+
* @param field - Field whose value is compared with `value`.
|
|
160
160
|
* @requiredField field
|
|
161
|
-
* @param value -
|
|
161
|
+
* @param value - Value to match.
|
|
162
162
|
* @requiredField value
|
|
163
163
|
* @returns An object with the filter definition, based on the supplied parameters.
|
|
164
164
|
*/
|
|
165
165
|
lt(field: string, value: Comparable): WixDataFilter;
|
|
166
166
|
/**
|
|
167
|
-
* Refines a filter to match items whose specified
|
|
167
|
+
* Refines a filter to match items whose specified field has any value.
|
|
168
168
|
*
|
|
169
|
-
* The `isNotEmpty()`
|
|
170
|
-
* value of the specified
|
|
169
|
+
* The `isNotEmpty()` method refines this filter to only match items where the
|
|
170
|
+
* value of the specified field is not `null` or `undefined`.
|
|
171
171
|
*
|
|
172
|
-
* If the
|
|
172
|
+
* If the field contains any value at all for a given item, including the
|
|
173
173
|
* empty string or an invalid value, that item will match the filter.
|
|
174
174
|
* @public
|
|
175
175
|
* @documentationMaturity preview
|
|
176
|
-
* @param field -
|
|
176
|
+
* @param field - Field in which to check for a value.
|
|
177
177
|
* @requiredField field
|
|
178
|
-
* @returns
|
|
178
|
+
* @returns Refined filter.
|
|
179
179
|
*/
|
|
180
180
|
isNotEmpty(field: string): WixDataFilter;
|
|
181
181
|
/**
|
|
182
|
-
* Refines a filter to match items whose specified
|
|
182
|
+
* Refines a filter to match items whose specified field does not exist or does not have any value.
|
|
183
183
|
*
|
|
184
|
-
* The `isEmpty()`
|
|
185
|
-
* value of the specified
|
|
184
|
+
* The `isEmpty()` method refines this filter to only match items where the
|
|
185
|
+
* value of the specified field is `null` or `undefined` or the field does
|
|
186
186
|
* not exist.
|
|
187
187
|
*
|
|
188
|
-
* If the
|
|
188
|
+
* If the field contains any value at all for a given item, including the
|
|
189
189
|
* empty string or an invalid value, that item will match the filter.
|
|
190
190
|
* @public
|
|
191
191
|
* @documentationMaturity preview
|
|
192
|
-
* @param field -
|
|
192
|
+
* @param field - Field in which to check for a value.
|
|
193
193
|
* @requiredField field
|
|
194
194
|
* @returns An object representing the refined filter.
|
|
195
195
|
*/
|
|
196
196
|
isEmpty(field: string): WixDataFilter;
|
|
197
197
|
/**
|
|
198
|
-
* Refines a filter to match items whose specified
|
|
198
|
+
* Refines a filter to match items whose specified field value starts with a specified string.
|
|
199
199
|
*
|
|
200
|
-
* The `startsWith()`
|
|
201
|
-
* only match items where the value of the specified
|
|
200
|
+
* The `startsWith()` method refines this filter to
|
|
201
|
+
* only match items where the value of the specified field starts with the
|
|
202
202
|
* defined `string`. Matching with `startsWith()` is not case sensitive, so `"TEXT"` starts
|
|
203
203
|
* with `"tex"`.
|
|
204
204
|
*
|
|
205
|
-
* You can only use `startsWith()` with a
|
|
205
|
+
* You can only use `startsWith()` with a field whose value is a String or Reference.
|
|
206
206
|
* When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.
|
|
207
207
|
* @public
|
|
208
208
|
* @documentationMaturity preview
|
|
209
|
-
* @param field -
|
|
209
|
+
* @param field - Field whose value is compared with the `value` parameter.
|
|
210
210
|
* @requiredField field
|
|
211
|
-
* @param value -
|
|
211
|
+
* @param value - Value to look for at the beginning of the specified field value.
|
|
212
212
|
* @requiredField value
|
|
213
|
-
* @returns
|
|
213
|
+
* @returns Refined filter.
|
|
214
214
|
*/
|
|
215
215
|
startsWith(field: string, value: string): WixDataFilter;
|
|
216
216
|
/**
|
|
217
|
-
* Refines a filter to match items whose specified
|
|
217
|
+
* Refines a filter to match items whose specified field value ends with a specified string.
|
|
218
218
|
*
|
|
219
|
-
* The `endsWith()`
|
|
220
|
-
* match items where the value of the specified
|
|
219
|
+
* The `endsWith()` method refines this filter to only
|
|
220
|
+
* match items where the value of the specified field ends with the specified
|
|
221
221
|
* `string`. Matching with `endsWith()` is not case sensitive, so `"TEXT"` ends
|
|
222
222
|
* with `"ext"`.
|
|
223
223
|
*
|
|
224
|
-
* You can only use `endsWith()` with a
|
|
224
|
+
* You can only use `endsWith()` with a field whose value is a String or Reference.
|
|
225
225
|
* When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.
|
|
226
226
|
* @public
|
|
227
227
|
* @documentationMaturity preview
|
|
228
|
-
* @param field -
|
|
228
|
+
* @param field - Field whose value is compared with the string.
|
|
229
229
|
* @requiredField field
|
|
230
|
-
* @param value -
|
|
230
|
+
* @param value - Value to look for at the end of the specified field value.
|
|
231
231
|
* @requiredField value
|
|
232
|
-
* @returns
|
|
232
|
+
* @returns Refined filter.
|
|
233
233
|
*/
|
|
234
234
|
endsWith(field: string, value: string): WixDataFilter;
|
|
235
235
|
/**
|
|
236
|
-
* Refines a filter to match items whose specified
|
|
236
|
+
* Refines a filter to match items whose specified field value contains the specified value.
|
|
237
237
|
*
|
|
238
|
-
* The `contains()`
|
|
239
|
-
* only match items where the value of the specified property contains the
|
|
240
|
-
* specified `string`. Matching with `contains()` is not case sensitive, so
|
|
241
|
-
* `"text"` does contain `"Tex"`.
|
|
238
|
+
* The `contains()` method refines the filter to only match items for which the value of the specified field contains the specified value. `contains()` is not case-sensitive, so the value `sunday` is considered to contain the value `Sun`.
|
|
242
239
|
*
|
|
243
|
-
* You can use `contains()` with a
|
|
244
|
-
* For properties of type reference it is recommended that you use the [`eq()`](#eq)
|
|
245
|
-
* function instead of `contains()`. With properties that are References, `contains()`
|
|
246
|
-
* matches by the ID of the referenced item as a String.
|
|
240
|
+
* You can use `contains()` with a field whose type is a string or a reference. However, for fields whose type is reference, `contains()` matches by the ID of the referenced item as a string. Instead, use the [`eq()`](https://dev.wix.com/docs/sdk/backend-modules/data/wix-data-items-sdk-1-0-0/wix-data-filter/eq) method.
|
|
247
241
|
* @public
|
|
248
242
|
* @documentationMaturity preview
|
|
249
|
-
* @param field -
|
|
243
|
+
* @param field - Field whose value is compared with the provided value.
|
|
250
244
|
* @requiredField field
|
|
251
|
-
* @param value -
|
|
245
|
+
* @param value - Value to locate in the specified field value.
|
|
252
246
|
* @requiredField value
|
|
253
|
-
* @returns
|
|
247
|
+
* @returns Refined filter.
|
|
254
248
|
*/
|
|
255
249
|
contains(field: string, value: string): WixDataFilter;
|
|
256
250
|
/**
|
|
257
|
-
* Refines a filter to match items whose specified
|
|
251
|
+
* Refines a filter to match items whose specified field value equals any of the specified `values`
|
|
258
252
|
* parameters.
|
|
259
253
|
*
|
|
260
|
-
* The `hasSome()`
|
|
261
|
-
* only match items where the value of the specified
|
|
254
|
+
* The `hasSome()` method refines this filter to
|
|
255
|
+
* only match items where the value of the specified field equals any of
|
|
262
256
|
* the specified values.
|
|
263
257
|
*
|
|
264
258
|
* Matching strings with `hasSome()` is case sensitive, so `"text"` is not equal to `"Text"`.
|
|
265
259
|
*
|
|
266
|
-
* If the value of the specified
|
|
260
|
+
* If the value of the specified field is an array, `hasSome()` will match
|
|
267
261
|
* if any of the elements of that array match any of the specified values.
|
|
268
262
|
*
|
|
269
|
-
* If the specified
|
|
270
|
-
* `value`
|
|
263
|
+
* If the specified field contains multiple references, pass item IDs in the
|
|
264
|
+
* `value` field. In such a case, `hasSome()` will match if any of the
|
|
271
265
|
* multiple references match any of the specified ID values.
|
|
272
266
|
*
|
|
273
267
|
* You can specify a list of values to match by providing an array of
|
|
274
268
|
* String, Number, or Date types as the `value` parameters.
|
|
275
269
|
* @public
|
|
276
270
|
* @documentationMaturity preview
|
|
277
|
-
* @param field -
|
|
271
|
+
* @param field - Field whose value is compared with `value`.
|
|
278
272
|
* @requiredField field
|
|
279
|
-
* @param values -
|
|
273
|
+
* @param values - Values to match.
|
|
280
274
|
* @requiredField values
|
|
281
275
|
* @returns An object representing the refined filter.
|
|
282
276
|
*/
|
|
@@ -288,16 +282,16 @@ export interface WixDataFilter {
|
|
|
288
282
|
*/
|
|
289
283
|
hasSome(field: string, values: Comparable[]): WixDataFilter;
|
|
290
284
|
/**
|
|
291
|
-
* Refines a filter to match items whose specified
|
|
285
|
+
* Refines a filter to match items whose specified field values equals all of the specified `value`
|
|
292
286
|
* parameters.
|
|
293
287
|
*
|
|
294
|
-
* The `hasAll()`
|
|
295
|
-
* only match items where the value of the specified
|
|
288
|
+
* The `hasAll()` method refines this filter to
|
|
289
|
+
* only match items where the value of the specified field equals all of
|
|
296
290
|
* the specified values.
|
|
297
291
|
*
|
|
298
292
|
* Matching strings with `hasAll()` is case sensitive, so `"text"` is not equal to `"Text"`.
|
|
299
293
|
*
|
|
300
|
-
* If the value of the specified
|
|
294
|
+
* If the value of the specified field is an array, `hasAll()` will match
|
|
301
295
|
* if there is a match in the elements of that array for all of the specified
|
|
302
296
|
* values.
|
|
303
297
|
*
|
|
@@ -305,9 +299,9 @@ export interface WixDataFilter {
|
|
|
305
299
|
* String, Number, or Date types as the `value` parameters.
|
|
306
300
|
* @public
|
|
307
301
|
* @documentationMaturity preview
|
|
308
|
-
* @param field -
|
|
302
|
+
* @param field - Field whose value is compared with `values`.
|
|
309
303
|
* @requiredField field
|
|
310
|
-
* @param values -
|
|
304
|
+
* @param values - Values to match.
|
|
311
305
|
* @requiredField values
|
|
312
306
|
* @returns An object representing the refined filter.
|
|
313
307
|
*/
|
|
@@ -321,12 +315,12 @@ export interface WixDataFilter {
|
|
|
321
315
|
/**
|
|
322
316
|
* Adds an `or` condition to the filter.
|
|
323
317
|
*
|
|
324
|
-
* The `or()`
|
|
318
|
+
* The `or()` method adds an inclusive `or` condition to this filter. A filter
|
|
325
319
|
* with an `or` returns all the items that match the filter as defined up to
|
|
326
|
-
* the `or`
|
|
327
|
-
*
|
|
320
|
+
* the `or` method, the items that match the filter passed to the `or`
|
|
321
|
+
* method, and the items that match both.
|
|
328
322
|
*
|
|
329
|
-
* The 'or()'
|
|
323
|
+
* The 'or()' method is designed to work with 2 or more queries or filters.
|
|
330
324
|
* If you use it on its own, it will return all the items in a collection.
|
|
331
325
|
* @public
|
|
332
326
|
* @documentationMaturity preview
|
|
@@ -338,20 +332,12 @@ export interface WixDataFilter {
|
|
|
338
332
|
/**
|
|
339
333
|
* Adds an `and` condition to the filter.
|
|
340
334
|
*
|
|
341
|
-
*
|
|
342
|
-
* that match the filter as defined up to the `and` function and also match the filter passed to
|
|
343
|
-
* the `and` function.
|
|
344
|
-
*
|
|
345
|
-
* Note that when chaining multiple `WixDataFilter` functions to a filter an and condition is assumed. In such cases,
|
|
346
|
-
* you do not need to add a call to the `and()` function. For example, this filter returns results where status is
|
|
347
|
-
* active **and** age is greater than 25.
|
|
348
|
-
* ```js
|
|
349
|
-
* wixClient.items.filter().eq("status", "active").gt("age", 25);
|
|
350
|
-
* ```
|
|
335
|
+
* A filter with an `and` condition returns all items that meet the conditions defined on both sides of the condition.
|
|
351
336
|
*
|
|
352
|
-
*
|
|
337
|
+
* Use the `and()` method when performing compound queries. For example, the final filter in this set of
|
|
353
338
|
* queries returns results where status is either pending or rejected **and** age is either less than 25 or greater
|
|
354
339
|
* than 65.
|
|
340
|
+
*
|
|
355
341
|
* ```js
|
|
356
342
|
* let statusFilter = wixClient.items.filter()
|
|
357
343
|
* .eq("status", "pending")
|
|
@@ -364,23 +350,29 @@ export interface WixDataFilter {
|
|
|
364
350
|
* let statusAndAgeFilter = statusFilter.and(ageFilter);
|
|
365
351
|
* ```
|
|
366
352
|
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
353
|
+
* > **Notes**:
|
|
354
|
+
* > The `and()` method is designed to work with 2 or more queries or filters. If used with a single query or filter, it returns all items in a collection.
|
|
355
|
+
* > When chaining multiple `WixDataFilter` methods to a filter, an `and` condition is implied. In such cases, you do not need to call the `and()` method explicitly. For example, this filter returns results where an item `status` is `active` and `age` is greater than 25:
|
|
356
|
+
*
|
|
357
|
+
* ```js
|
|
358
|
+
* wixClient.items.filter().eq("status", "active").gt("age", 25);
|
|
359
|
+
* ```
|
|
360
|
+
*
|
|
369
361
|
* @public
|
|
370
362
|
* @documentationMaturity preview
|
|
371
|
-
* @param filter -
|
|
363
|
+
* @param filter - `WixDataFilter` used with an `and` condition.
|
|
372
364
|
* @requiredField filter
|
|
373
|
-
* @returns
|
|
365
|
+
* @returns The compound filter.
|
|
374
366
|
*/
|
|
375
367
|
and(filter: WixDataFilter): WixDataFilter;
|
|
376
368
|
/**
|
|
377
369
|
* Adds a `not` condition to the filter.
|
|
378
370
|
*
|
|
379
|
-
* The `not()`
|
|
371
|
+
* The `not()` method adds a `not` condition to this filter. A filter with a `not`
|
|
380
372
|
* returns all the items that match the filter as defined up to the `not`
|
|
381
|
-
*
|
|
373
|
+
* method, but don't match the filter passed to the `not` method.
|
|
382
374
|
*
|
|
383
|
-
* If the filter only contains a `not()`
|
|
375
|
+
* If the filter only contains a `not()` method, it returns all the items
|
|
384
376
|
* that don't match the filter defined by the `not` method.
|
|
385
377
|
*
|
|
386
378
|
* @public
|
|
@@ -391,32 +383,29 @@ export interface WixDataFilter {
|
|
|
391
383
|
*/
|
|
392
384
|
not(filter: WixDataFilter): WixDataFilter;
|
|
393
385
|
/**
|
|
394
|
-
* Refines a filter to match items whose specified
|
|
386
|
+
* Refines a filter to match items whose specified field value is within the defined range.
|
|
395
387
|
*
|
|
396
|
-
* The `between()`
|
|
397
|
-
* greater than or equal to `rangeStart` and less than `rangeEnd`.
|
|
388
|
+
* The `between()` method refines this filter to match items for which the value of the specified field is greater than or equal to `rangeStart` and less than `rangeEnd`. The method only matches values of [the same type](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-type).
|
|
398
389
|
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
390
|
+
* The following types can be compared:
|
|
391
|
+
* - Number: Compared numerically.
|
|
392
|
+
* - Date: Compared as JavaScript Date objects.
|
|
393
|
+
* - String: Compared lexicographically:
|
|
394
|
+
* - `"A"` and `"M"` are considered between `"A"` and `"Z"`, but `"a"`, `"m"`, `"z"` and `"Z"` are not.
|
|
395
|
+
* - `"A"`, `"M"`, `"Z"`, and `"a"` are considered between `"A"` and `"z"`, but `"z"` is not.
|
|
401
396
|
*
|
|
402
|
-
* If a property contains a number as a String, that value will be compared alphabetically and not numerically. Items
|
|
403
|
-
* that do not have a value for the specified property are ranked lowest.
|
|
404
397
|
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
* - Date: Compares JavaScript Date objects.
|
|
408
|
-
* - String: Compares lexicographically, so
|
|
409
|
-
* - `"A"` and `"M"` are between `"A"` and `"Z"`, but `"a"`, `"m"`, `"z"` and `"Z"` are not.
|
|
410
|
-
* - `"A"`, `"M"`, `"Z"`, and `"a"` are between `"A"` and `"z"`, but `"z"` is not.
|
|
398
|
+
* > **Note**: Items that do not have a value for the specified field are considered as the lowest comparable value and are ranked last.
|
|
399
|
+
*
|
|
411
400
|
* @public
|
|
412
401
|
* @documentationMaturity preview
|
|
413
|
-
* @param field -
|
|
402
|
+
* @param field - field whose value is compared with `rangeStart` and `rangeEnd`.
|
|
414
403
|
* @requiredField field
|
|
415
|
-
* @param rangeStart -
|
|
404
|
+
* @param rangeStart - Starting value of the range to match.
|
|
416
405
|
* @requiredField rangeStart
|
|
417
|
-
* @param rangeEnd -
|
|
406
|
+
* @param rangeEnd - Ending value of the range to match.
|
|
418
407
|
* @requiredField rangeEnd
|
|
419
|
-
* @returns
|
|
408
|
+
* @returns Refined filter.
|
|
420
409
|
*/
|
|
421
410
|
between<T extends Comparable>(field: string, rangeStart: T, rangeEnd: T): WixDataFilter;
|
|
422
411
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WixDataFilter.d.ts","sourceRoot":"","sources":["../../../src/api/WixDataFilter.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;AAExC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,aAAa,CAAA;IAE5C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,aAAa,CAAA;IAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,aAAa,CAAA;IAEnD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,aAAa,CAAA;IAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,aAAa,CAAA;IAEnD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,aAAa,CAAA;IAEnD;;;;;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