@ahoo-wang/wow-client 10.0.0-alpha.7 → 10.0.0-beta.2
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/README.md +8 -5
- package/README.zh-CN.md +4 -3
- package/dist/commands.cjs +1 -1
- package/dist/commands.cjs.map +1 -1
- package/dist/commands.d.cts +9 -13
- package/dist/commands.d.ts +9 -13
- package/dist/commands.es.js +60 -54
- package/dist/commands.es.js.map +1 -1
- package/dist/dsl/aggregation/admit.cjs +1 -1
- package/dist/dsl/aggregation/admit.cjs.map +1 -1
- package/dist/dsl/aggregation/admit.es.js +73 -69
- package/dist/dsl/aggregation/admit.es.js.map +1 -1
- package/dist/dsl/aggregation/aliases.cjs +2 -0
- package/dist/dsl/aggregation/aliases.cjs.map +1 -0
- package/dist/dsl/aggregation/aliases.d.cts +2 -0
- package/dist/dsl/aggregation/aliases.d.ts +2 -0
- package/dist/dsl/aggregation/aliases.es.js +13 -0
- package/dist/dsl/aggregation/aliases.es.js.map +1 -0
- package/dist/dsl/aggregation/builders.cjs +1 -1
- package/dist/dsl/aggregation/builders.cjs.map +1 -1
- package/dist/dsl/aggregation/builders.d.cts +17 -243
- package/dist/dsl/aggregation/builders.d.ts +17 -243
- package/dist/dsl/aggregation/builders.es.js +36 -171
- package/dist/dsl/aggregation/builders.es.js.map +1 -1
- package/dist/dsl/aggregation/derived.cjs +1 -1
- package/dist/dsl/aggregation/derived.cjs.map +1 -1
- package/dist/dsl/aggregation/derived.d.cts +123 -1
- package/dist/dsl/aggregation/derived.d.ts +123 -1
- package/dist/dsl/aggregation/derived.es.js +43 -28
- package/dist/dsl/aggregation/derived.es.js.map +1 -1
- package/dist/dsl/aggregation/groups.cjs +2 -0
- package/dist/dsl/aggregation/groups.cjs.map +1 -0
- package/dist/dsl/aggregation/groups.d.cts +325 -0
- package/dist/dsl/aggregation/groups.d.ts +325 -0
- package/dist/dsl/aggregation/groups.es.js +80 -0
- package/dist/dsl/aggregation/groups.es.js.map +1 -0
- package/dist/dsl/aggregation/having.cjs +1 -1
- package/dist/dsl/aggregation/having.cjs.map +1 -1
- package/dist/dsl/aggregation/having.d.cts +63 -1
- package/dist/dsl/aggregation/having.d.ts +63 -1
- package/dist/dsl/aggregation/having.es.js +33 -30
- package/dist/dsl/aggregation/having.es.js.map +1 -1
- package/dist/dsl/aggregation/index.d.cts +4 -2
- package/dist/dsl/aggregation/index.d.ts +4 -2
- package/dist/dsl/aggregation/metrics.cjs +2 -0
- package/dist/dsl/aggregation/metrics.cjs.map +1 -0
- package/dist/dsl/aggregation/metrics.d.cts +279 -0
- package/dist/dsl/aggregation/metrics.d.ts +279 -0
- package/dist/dsl/aggregation/metrics.es.js +75 -0
- package/dist/dsl/aggregation/metrics.es.js.map +1 -0
- package/dist/dsl/aggregation/types.cjs +1 -1
- package/dist/dsl/aggregation/types.cjs.map +1 -1
- package/dist/dsl/aggregation/types.d.cts +4 -524
- package/dist/dsl/aggregation/types.d.ts +4 -524
- package/dist/dsl/aggregation/types.es.js +5 -25
- package/dist/dsl/aggregation/types.es.js.map +1 -1
- package/dist/dsl/cursorQuery.cjs +1 -1
- package/dist/dsl/cursorQuery.cjs.map +1 -1
- package/dist/dsl/cursorQuery.d.cts +18 -7
- package/dist/dsl/cursorQuery.d.ts +18 -7
- package/dist/dsl/cursorQuery.es.js +13 -12
- package/dist/dsl/cursorQuery.es.js.map +1 -1
- package/dist/dsl/descriptor.cjs +1 -1
- package/dist/dsl/descriptor.cjs.map +1 -1
- package/dist/dsl/descriptor.d.cts +24 -379
- package/dist/dsl/descriptor.d.ts +24 -379
- package/dist/dsl/descriptor.es.js +6 -32
- package/dist/dsl/descriptor.es.js.map +1 -1
- package/dist/dsl/fieldDescriptor.cjs +2 -0
- package/dist/dsl/fieldDescriptor.cjs.map +1 -0
- package/dist/dsl/fieldDescriptor.d.cts +246 -0
- package/dist/dsl/fieldDescriptor.d.ts +246 -0
- package/dist/dsl/fieldDescriptor.es.js +24 -0
- package/dist/dsl/fieldDescriptor.es.js.map +1 -0
- package/dist/dsl/filter/builders.cjs +1 -1
- package/dist/dsl/filter/builders.cjs.map +1 -1
- package/dist/dsl/filter/builders.d.cts +7 -949
- package/dist/dsl/filter/builders.d.ts +7 -949
- package/dist/dsl/filter/builders.es.js +14 -285
- package/dist/dsl/filter/builders.es.js.map +1 -1
- package/dist/dsl/filter/expressionFilter.cjs +2 -0
- package/dist/dsl/filter/expressionFilter.cjs.map +1 -0
- package/dist/dsl/filter/expressionFilter.d.cts +35 -0
- package/dist/dsl/filter/expressionFilter.d.ts +35 -0
- package/dist/dsl/filter/expressionFilter.es.js +18 -0
- package/dist/dsl/filter/expressionFilter.es.js.map +1 -0
- package/dist/dsl/filter/fieldFilters.cjs +2 -0
- package/dist/dsl/filter/fieldFilters.cjs.map +1 -0
- package/dist/dsl/filter/fieldFilters.d.cts +297 -0
- package/dist/dsl/filter/fieldFilters.d.ts +297 -0
- package/dist/dsl/filter/fieldFilters.es.js +110 -0
- package/dist/dsl/filter/fieldFilters.es.js.map +1 -0
- package/dist/dsl/filter/index.d.cts +2 -1
- package/dist/dsl/filter/index.d.ts +2 -1
- package/dist/dsl/filter/logicalFilters.cjs +2 -0
- package/dist/dsl/filter/logicalFilters.cjs.map +1 -0
- package/dist/dsl/filter/logicalFilters.d.cts +109 -0
- package/dist/dsl/filter/logicalFilters.d.ts +109 -0
- package/dist/dsl/filter/logicalFilters.es.js +36 -0
- package/dist/dsl/filter/logicalFilters.es.js.map +1 -0
- package/dist/dsl/filter/metadataFilters.cjs +2 -0
- package/dist/dsl/filter/metadataFilters.cjs.map +1 -0
- package/dist/dsl/filter/metadataFilters.d.cts +132 -0
- package/dist/dsl/filter/metadataFilters.d.ts +132 -0
- package/dist/dsl/filter/metadataFilters.es.js +56 -0
- package/dist/dsl/filter/metadataFilters.es.js.map +1 -0
- package/dist/dsl/filter/operator.cjs +1 -1
- package/dist/dsl/filter/operator.cjs.map +1 -1
- package/dist/dsl/filter/operator.d.cts +11 -9
- package/dist/dsl/filter/operator.d.ts +11 -9
- package/dist/dsl/filter/operator.es.js +1 -1
- package/dist/dsl/filter/operator.es.js.map +1 -1
- package/dist/dsl/filter/searchFilter.cjs +2 -0
- package/dist/dsl/filter/searchFilter.cjs.map +1 -0
- package/dist/dsl/filter/searchFilter.d.cts +39 -0
- package/dist/dsl/filter/searchFilter.d.ts +39 -0
- package/dist/dsl/filter/searchFilter.es.js +19 -0
- package/dist/dsl/filter/searchFilter.es.js.map +1 -0
- package/dist/dsl/filter/timeFilters.cjs +2 -0
- package/dist/dsl/filter/timeFilters.cjs.map +1 -0
- package/dist/dsl/filter/timeFilters.d.cts +290 -0
- package/dist/dsl/filter/timeFilters.d.ts +290 -0
- package/dist/dsl/filter/timeFilters.es.js +89 -0
- package/dist/dsl/filter/timeFilters.es.js.map +1 -0
- package/dist/dsl/filter/types.d.cts +4 -14
- package/dist/dsl/filter/types.d.ts +4 -14
- package/dist/dsl/filter/validate.cjs +1 -1
- package/dist/dsl/filter/validate.cjs.map +1 -1
- package/dist/dsl/filter/validate.d.cts +2 -4
- package/dist/dsl/filter/validate.d.ts +2 -4
- package/dist/dsl/filter/validate.es.js +25 -31
- package/dist/dsl/filter/validate.es.js.map +1 -1
- package/dist/dsl/queryErrorCodes.cjs +1 -1
- package/dist/dsl/queryErrorCodes.cjs.map +1 -1
- package/dist/dsl/queryErrorCodes.d.cts +0 -2
- package/dist/dsl/queryErrorCodes.d.ts +0 -2
- package/dist/dsl/queryErrorCodes.es.js +0 -1
- package/dist/dsl/queryErrorCodes.es.js.map +1 -1
- package/dist/dsl/queryFilter.cjs +2 -0
- package/dist/dsl/queryFilter.cjs.map +1 -0
- package/dist/dsl/queryFilter.d.cts +3 -0
- package/dist/dsl/queryFilter.d.ts +3 -0
- package/dist/dsl/queryFilter.es.js +9 -0
- package/dist/dsl/queryFilter.es.js.map +1 -0
- package/dist/dsl/queryable.cjs +1 -1
- package/dist/dsl/queryable.cjs.map +1 -1
- package/dist/dsl/queryable.es.js +12 -16
- package/dist/dsl/queryable.es.js.map +1 -1
- package/dist/dsl/semanticTypes.cjs +2 -0
- package/dist/dsl/semanticTypes.cjs.map +1 -0
- package/dist/dsl/semanticTypes.d.cts +128 -0
- package/dist/dsl/semanticTypes.d.ts +128 -0
- package/dist/dsl/semanticTypes.es.js +13 -0
- package/dist/dsl/semanticTypes.es.js.map +1 -0
- package/dist/dsl.cjs +1 -1
- package/dist/dsl.d.cts +2 -0
- package/dist/dsl.d.ts +2 -0
- package/dist/dsl.es.js +14 -8
- package/dist/exactJson.cjs +2 -2
- package/dist/exactJson.cjs.map +1 -1
- package/dist/exactJson.d.cts +41 -16
- package/dist/exactJson.d.ts +41 -16
- package/dist/exactJson.es.js +104 -102
- package/dist/exactJson.es.js.map +1 -1
- package/dist/frameworkErrors.cjs.map +1 -1
- package/dist/frameworkErrors.d.cts +5 -5
- package/dist/frameworkErrors.d.ts +5 -5
- package/dist/frameworkErrors.es.js.map +1 -1
- package/dist/http.cjs +1 -1
- package/dist/http.cjs.map +1 -1
- package/dist/http.d.cts +29 -9
- package/dist/http.d.ts +29 -9
- package/dist/http.es.js +24 -19
- package/dist/http.es.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.es.js +12 -12
- package/dist/manifest.cjs +1 -1
- package/dist/manifest.cjs.map +1 -1
- package/dist/manifest.d.cts +30 -2
- package/dist/manifest.d.ts +30 -2
- package/dist/manifest.es.js +34 -6
- package/dist/manifest.es.js.map +1 -1
- package/dist/manifestTypes.d.cts +21 -4
- package/dist/manifestTypes.d.ts +21 -4
- package/dist/queries.cjs +1 -1
- package/dist/queries.cjs.map +1 -1
- package/dist/queries.d.cts +18 -8
- package/dist/queries.d.ts +18 -8
- package/dist/queries.es.js +46 -35
- package/dist/queries.es.js.map +1 -1
- package/dist/routes.cjs +1 -1
- package/dist/routes.cjs.map +1 -1
- package/dist/routes.d.cts +16 -3
- package/dist/routes.d.ts +16 -3
- package/dist/routes.es.js +24 -25
- package/dist/routes.es.js.map +1 -1
- package/dist/state.cjs +1 -1
- package/dist/state.cjs.map +1 -1
- package/dist/state.d.cts +21 -19
- package/dist/state.d.ts +21 -19
- package/dist/state.es.js +27 -22
- package/dist/state.es.js.map +1 -1
- package/dist/streams.cjs +1 -1
- package/dist/streams.cjs.map +1 -1
- package/dist/streams.d.cts +14 -7
- package/dist/streams.d.ts +14 -7
- package/dist/streams.es.js +65 -50
- package/dist/streams.es.js.map +1 -1
- package/dist/testing/wire.cjs +1 -1
- package/dist/testing/wire.cjs.map +1 -1
- package/dist/testing/wire.es.js +1 -1
- package/dist/testing/wire.es.js.map +1 -1
- package/dist/wait.cjs +1 -1
- package/dist/wait.cjs.map +1 -1
- package/dist/wait.d.cts +18 -5
- package/dist/wait.d.ts +18 -5
- package/dist/wait.es.js +36 -34
- package/dist/wait.es.js.map +1 -1
- package/dist/wire.cjs +1 -1
- package/dist/wire.cjs.map +1 -1
- package/dist/wire.d.cts +76 -31
- package/dist/wire.d.ts +76 -31
- package/dist/wire.es.js +1 -3
- package/dist/wire.es.js.map +1 -1
- package/package.json +5 -5
- package/dist/dsl/filter/datePattern.cjs +0 -2
- package/dist/dsl/filter/datePattern.cjs.map +0 -1
- package/dist/dsl/filter/datePattern.d.cts +0 -8
- package/dist/dsl/filter/datePattern.d.ts +0 -8
- package/dist/dsl/filter/datePattern.es.js +0 -96
- package/dist/dsl/filter/datePattern.es.js.map +0 -1
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { StringComparison } from './operator.cjs';
|
|
2
|
+
import { BetweenFilter, CollectionFilter, ComparableFilterLiteral, ComparisonFilter, EqualityFilter, EqualityFilterValue, FieldPresenceFilter, StringFilter } from './types.cjs';
|
|
3
|
+
/** The filters on a field's value: equality, order, text, collections, ranges and presence. */
|
|
4
|
+
export declare const fieldFilters: {
|
|
5
|
+
/**
|
|
6
|
+
* Matches records whose `field` equals `value`.
|
|
7
|
+
*
|
|
8
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
9
|
+
* @param value - JSON scalar. `null` is sent as is; the server rewrites it
|
|
10
|
+
* to `IS_NULL`.
|
|
11
|
+
* @returns `{ op: 'eq', field, value }`.
|
|
12
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not
|
|
13
|
+
* `null`, a string, a boolean or a finite number.
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* filter.eq('state.status', 'PAID');
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
eq<FIELDS extends string>(field: FIELDS, value: EqualityFilterValue): EqualityFilter<FIELDS>;
|
|
20
|
+
/**
|
|
21
|
+
* Matches records whose `field` does not equal `value`.
|
|
22
|
+
*
|
|
23
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
24
|
+
* @param value - JSON scalar. `null` is sent as is; the server rewrites it
|
|
25
|
+
* to `IS_NOT_NULL`.
|
|
26
|
+
* @returns `{ op: 'ne', field, value }`.
|
|
27
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not
|
|
28
|
+
* `null`, a string, a boolean or a finite number.
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* filter.ne('state.status', 'CANCELLED');
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
ne<FIELDS extends string>(field: FIELDS, value: EqualityFilterValue): EqualityFilter<FIELDS>;
|
|
35
|
+
/**
|
|
36
|
+
* Matches records whose `field` is greater than `value` (`field > value`).
|
|
37
|
+
* Numbers compare at the backend's stored precision.
|
|
38
|
+
*
|
|
39
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
40
|
+
* @param value - Non-null JSON scalar.
|
|
41
|
+
* @returns `{ op: 'gt', field, value }`.
|
|
42
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not a
|
|
43
|
+
* string, a boolean or a finite number.
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* filter.gt('state.total', 100);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
gt<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
|
|
50
|
+
/**
|
|
51
|
+
* Matches records whose `field` is greater than or equal to `value` (`field >= value`).
|
|
52
|
+
* Numbers compare at the backend's stored precision.
|
|
53
|
+
*
|
|
54
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
55
|
+
* @param value - Non-null JSON scalar.
|
|
56
|
+
* @returns `{ op: 'gte', field, value }`.
|
|
57
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not a
|
|
58
|
+
* string, a boolean or a finite number.
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* filter.gte('state.total', 100);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
gte<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
|
|
65
|
+
/**
|
|
66
|
+
* Matches records whose `field` is less than `value` (`field < value`).
|
|
67
|
+
* Numbers compare at the backend's stored precision.
|
|
68
|
+
*
|
|
69
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
70
|
+
* @param value - Non-null JSON scalar.
|
|
71
|
+
* @returns `{ op: 'lt', field, value }`.
|
|
72
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not a
|
|
73
|
+
* string, a boolean or a finite number.
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* filter.lt('state.total', 100);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
lt<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
|
|
80
|
+
/**
|
|
81
|
+
* Matches records whose `field` is less than or equal to `value` (`field <= value`).
|
|
82
|
+
* Numbers compare at the backend's stored precision.
|
|
83
|
+
*
|
|
84
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
85
|
+
* @param value - Non-null JSON scalar.
|
|
86
|
+
* @returns `{ op: 'lte', field, value }`.
|
|
87
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not a
|
|
88
|
+
* string, a boolean or a finite number.
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* filter.lte('state.total', 100);
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
lte<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
|
|
95
|
+
/**
|
|
96
|
+
* Matches records whose string `field` contains `value` literally. No
|
|
97
|
+
* full-text analyzer is applied.
|
|
98
|
+
*
|
|
99
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
100
|
+
* @param value - Literal text.
|
|
101
|
+
* @param stringComparison - Case handling. Defaults to
|
|
102
|
+
* `StringComparison.CASE_SENSITIVE`.
|
|
103
|
+
* @returns `{ op: 'contains', field, value, stringComparison }`.
|
|
104
|
+
* @throws TypeError If `stringComparison` is not a {@link StringComparison}
|
|
105
|
+
* member, `field` is not a valid query field path, or `value` is not a string.
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* filter.contains('state.note', 'vip', StringComparison.CASE_INSENSITIVE);
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
contains<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
|
|
112
|
+
/**
|
|
113
|
+
* Matches records whose string `field` starts with `value` literally. No
|
|
114
|
+
* full-text analyzer is applied.
|
|
115
|
+
*
|
|
116
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
117
|
+
* @param value - Literal text.
|
|
118
|
+
* @param stringComparison - Case handling. Defaults to
|
|
119
|
+
* `StringComparison.CASE_SENSITIVE`.
|
|
120
|
+
* @returns `{ op: 'starts-with', field, value, stringComparison }`.
|
|
121
|
+
* @throws TypeError If `stringComparison` is not a {@link StringComparison}
|
|
122
|
+
* member, `field` is not a valid query field path, or `value` is not a string.
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* filter.startsWith('state.note', 'VIP-', StringComparison.CASE_INSENSITIVE);
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
startsWith<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
|
|
129
|
+
/**
|
|
130
|
+
* Matches records whose string `field` ends with `value` literally. No
|
|
131
|
+
* full-text analyzer is applied.
|
|
132
|
+
*
|
|
133
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
134
|
+
* @param value - Literal text.
|
|
135
|
+
* @param stringComparison - Case handling. Defaults to
|
|
136
|
+
* `StringComparison.CASE_SENSITIVE`.
|
|
137
|
+
* @returns `{ op: 'ends-with', field, value, stringComparison }`.
|
|
138
|
+
* @throws TypeError If `stringComparison` is not a {@link StringComparison}
|
|
139
|
+
* member, `field` is not a valid query field path, or `value` is not a string.
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* filter.endsWith('state.note', '.pdf', StringComparison.CASE_INSENSITIVE);
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
endsWith<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
|
|
146
|
+
/**
|
|
147
|
+
* Matches records whose `field` equals one of `values`.
|
|
148
|
+
*
|
|
149
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
150
|
+
* @param values - Non-empty list of non-null JSON scalars.
|
|
151
|
+
* @returns `{ op: 'in', field, values }` with a copy of `values`.
|
|
152
|
+
* @throws TypeError If `values` is empty, contains `null` or `undefined`,
|
|
153
|
+
* or contains a value that is not a string, a boolean or a finite
|
|
154
|
+
* number, or if `field` is not a valid query field path.
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* filter.isIn('state.status', ['PAID', 'SHIPPED']);
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
isIn<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
|
|
161
|
+
/**
|
|
162
|
+
* Matches records whose `field` equals none of `values`.
|
|
163
|
+
*
|
|
164
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
165
|
+
* @param values - Non-empty list of non-null JSON scalars.
|
|
166
|
+
* @returns `{ op: 'not-in', field, values }` with a copy of `values`.
|
|
167
|
+
* @throws TypeError If `values` is empty, contains `null` or `undefined`,
|
|
168
|
+
* or contains a value that is not a string, a boolean or a finite
|
|
169
|
+
* number, or if `field` is not a valid query field path.
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* filter.notIn('state.status', ['CANCELLED', 'REFUNDED']);
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
notIn<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
|
|
176
|
+
/**
|
|
177
|
+
* Matches records whose array `field` contains every value in `values`.
|
|
178
|
+
*
|
|
179
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
180
|
+
* @param values - Non-empty list of non-null JSON scalars.
|
|
181
|
+
* @returns `{ op: 'contains-all', field, values }` with a copy of `values`.
|
|
182
|
+
* @throws TypeError If `values` is empty, contains `null` or `undefined`,
|
|
183
|
+
* or contains a value that is not a string, a boolean or a finite
|
|
184
|
+
* number, or if `field` is not a valid query field path.
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* filter.containsAll('access.teams', ['sales', 'support']);
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
containsAll<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
|
|
191
|
+
/**
|
|
192
|
+
* Matches records whose `field` lies in the inclusive range
|
|
193
|
+
* `lowerBound <= field <= upperBound`.
|
|
194
|
+
*
|
|
195
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
196
|
+
* @param lowerBound - Inclusive lower bound; non-null JSON scalar.
|
|
197
|
+
* @param upperBound - Inclusive upper bound; non-null JSON scalar.
|
|
198
|
+
* @returns `{ op: 'between', field, lowerBound, upperBound }`.
|
|
199
|
+
* @throws TypeError If `field` is not a valid query field path, or either bound is not a
|
|
200
|
+
* string, a boolean or a finite number.
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* filter.between('state.total', 100, 200);
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
between<FIELDS extends string>(field: FIELDS, lowerBound: ComparableFilterLiteral, upperBound: ComparableFilterLiteral): BetweenFilter<FIELDS>;
|
|
207
|
+
/**
|
|
208
|
+
* Matches records whose array `field` is empty. On Elasticsearch it may also
|
|
209
|
+
* match a missing or `null` field.
|
|
210
|
+
*
|
|
211
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
212
|
+
* @returns `{ op: 'is-empty', field }`.
|
|
213
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* filter.isEmpty('state.items');
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
isEmpty<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
220
|
+
/**
|
|
221
|
+
* Matches records whose string `field` equals `""`. Whitespace-only
|
|
222
|
+
* strings do not match.
|
|
223
|
+
*
|
|
224
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
225
|
+
* @returns `{ op: 'is-empty-string', field }`.
|
|
226
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
227
|
+
* @example
|
|
228
|
+
* ```typescript
|
|
229
|
+
* filter.isEmptyString('state.note');
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
isEmptyString<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
233
|
+
/**
|
|
234
|
+
* Matches records whose string `field` exists, is not `null` and is not
|
|
235
|
+
* `""`.
|
|
236
|
+
*
|
|
237
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
238
|
+
* @returns `{ op: 'is-not-empty-string', field }`.
|
|
239
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
240
|
+
* @example
|
|
241
|
+
* ```typescript
|
|
242
|
+
* filter.isNotEmptyString('state.note');
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
isNotEmptyString<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
246
|
+
/**
|
|
247
|
+
* Matches records whose `field` is `null` or missing, following the
|
|
248
|
+
* backend's null semantics.
|
|
249
|
+
*
|
|
250
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
251
|
+
* @returns `{ op: 'is-null', field }`.
|
|
252
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
253
|
+
* @example
|
|
254
|
+
* ```typescript
|
|
255
|
+
* filter.isNull('state.note');
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
isNull<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
259
|
+
/**
|
|
260
|
+
* Matches records whose `field` exists and is not `null`, following the
|
|
261
|
+
* backend's null semantics.
|
|
262
|
+
*
|
|
263
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
264
|
+
* @returns `{ op: 'is-not-null', field }`.
|
|
265
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
266
|
+
* @example
|
|
267
|
+
* ```typescript
|
|
268
|
+
* filter.isNotNull('state.note');
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
isNotNull<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
272
|
+
/**
|
|
273
|
+
* Matches records where `field` exists. On MongoDB this includes a `null`
|
|
274
|
+
* value.
|
|
275
|
+
*
|
|
276
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
277
|
+
* @returns `{ op: 'exists', field }`.
|
|
278
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
279
|
+
* @example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* filter.exists('state.note');
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
exists<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
285
|
+
/**
|
|
286
|
+
* Matches records where `field` is missing.
|
|
287
|
+
*
|
|
288
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
289
|
+
* @returns `{ op: 'not-exists', field }`.
|
|
290
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
291
|
+
* @example
|
|
292
|
+
* ```typescript
|
|
293
|
+
* filter.notExists('state.note');
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
notExists<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
297
|
+
};
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { StringComparison } from './operator.js';
|
|
2
|
+
import { BetweenFilter, CollectionFilter, ComparableFilterLiteral, ComparisonFilter, EqualityFilter, EqualityFilterValue, FieldPresenceFilter, StringFilter } from './types.js';
|
|
3
|
+
/** The filters on a field's value: equality, order, text, collections, ranges and presence. */
|
|
4
|
+
export declare const fieldFilters: {
|
|
5
|
+
/**
|
|
6
|
+
* Matches records whose `field` equals `value`.
|
|
7
|
+
*
|
|
8
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
9
|
+
* @param value - JSON scalar. `null` is sent as is; the server rewrites it
|
|
10
|
+
* to `IS_NULL`.
|
|
11
|
+
* @returns `{ op: 'eq', field, value }`.
|
|
12
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not
|
|
13
|
+
* `null`, a string, a boolean or a finite number.
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* filter.eq('state.status', 'PAID');
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
eq<FIELDS extends string>(field: FIELDS, value: EqualityFilterValue): EqualityFilter<FIELDS>;
|
|
20
|
+
/**
|
|
21
|
+
* Matches records whose `field` does not equal `value`.
|
|
22
|
+
*
|
|
23
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
24
|
+
* @param value - JSON scalar. `null` is sent as is; the server rewrites it
|
|
25
|
+
* to `IS_NOT_NULL`.
|
|
26
|
+
* @returns `{ op: 'ne', field, value }`.
|
|
27
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not
|
|
28
|
+
* `null`, a string, a boolean or a finite number.
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* filter.ne('state.status', 'CANCELLED');
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
ne<FIELDS extends string>(field: FIELDS, value: EqualityFilterValue): EqualityFilter<FIELDS>;
|
|
35
|
+
/**
|
|
36
|
+
* Matches records whose `field` is greater than `value` (`field > value`).
|
|
37
|
+
* Numbers compare at the backend's stored precision.
|
|
38
|
+
*
|
|
39
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
40
|
+
* @param value - Non-null JSON scalar.
|
|
41
|
+
* @returns `{ op: 'gt', field, value }`.
|
|
42
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not a
|
|
43
|
+
* string, a boolean or a finite number.
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* filter.gt('state.total', 100);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
gt<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
|
|
50
|
+
/**
|
|
51
|
+
* Matches records whose `field` is greater than or equal to `value` (`field >= value`).
|
|
52
|
+
* Numbers compare at the backend's stored precision.
|
|
53
|
+
*
|
|
54
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
55
|
+
* @param value - Non-null JSON scalar.
|
|
56
|
+
* @returns `{ op: 'gte', field, value }`.
|
|
57
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not a
|
|
58
|
+
* string, a boolean or a finite number.
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* filter.gte('state.total', 100);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
gte<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
|
|
65
|
+
/**
|
|
66
|
+
* Matches records whose `field` is less than `value` (`field < value`).
|
|
67
|
+
* Numbers compare at the backend's stored precision.
|
|
68
|
+
*
|
|
69
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
70
|
+
* @param value - Non-null JSON scalar.
|
|
71
|
+
* @returns `{ op: 'lt', field, value }`.
|
|
72
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not a
|
|
73
|
+
* string, a boolean or a finite number.
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* filter.lt('state.total', 100);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
lt<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
|
|
80
|
+
/**
|
|
81
|
+
* Matches records whose `field` is less than or equal to `value` (`field <= value`).
|
|
82
|
+
* Numbers compare at the backend's stored precision.
|
|
83
|
+
*
|
|
84
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
85
|
+
* @param value - Non-null JSON scalar.
|
|
86
|
+
* @returns `{ op: 'lte', field, value }`.
|
|
87
|
+
* @throws TypeError If `field` is not a valid query field path, or `value` is not a
|
|
88
|
+
* string, a boolean or a finite number.
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* filter.lte('state.total', 100);
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
lte<FIELDS extends string>(field: FIELDS, value: ComparableFilterLiteral): ComparisonFilter<FIELDS>;
|
|
95
|
+
/**
|
|
96
|
+
* Matches records whose string `field` contains `value` literally. No
|
|
97
|
+
* full-text analyzer is applied.
|
|
98
|
+
*
|
|
99
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
100
|
+
* @param value - Literal text.
|
|
101
|
+
* @param stringComparison - Case handling. Defaults to
|
|
102
|
+
* `StringComparison.CASE_SENSITIVE`.
|
|
103
|
+
* @returns `{ op: 'contains', field, value, stringComparison }`.
|
|
104
|
+
* @throws TypeError If `stringComparison` is not a {@link StringComparison}
|
|
105
|
+
* member, `field` is not a valid query field path, or `value` is not a string.
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* filter.contains('state.note', 'vip', StringComparison.CASE_INSENSITIVE);
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
contains<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
|
|
112
|
+
/**
|
|
113
|
+
* Matches records whose string `field` starts with `value` literally. No
|
|
114
|
+
* full-text analyzer is applied.
|
|
115
|
+
*
|
|
116
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
117
|
+
* @param value - Literal text.
|
|
118
|
+
* @param stringComparison - Case handling. Defaults to
|
|
119
|
+
* `StringComparison.CASE_SENSITIVE`.
|
|
120
|
+
* @returns `{ op: 'starts-with', field, value, stringComparison }`.
|
|
121
|
+
* @throws TypeError If `stringComparison` is not a {@link StringComparison}
|
|
122
|
+
* member, `field` is not a valid query field path, or `value` is not a string.
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* filter.startsWith('state.note', 'VIP-', StringComparison.CASE_INSENSITIVE);
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
startsWith<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
|
|
129
|
+
/**
|
|
130
|
+
* Matches records whose string `field` ends with `value` literally. No
|
|
131
|
+
* full-text analyzer is applied.
|
|
132
|
+
*
|
|
133
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
134
|
+
* @param value - Literal text.
|
|
135
|
+
* @param stringComparison - Case handling. Defaults to
|
|
136
|
+
* `StringComparison.CASE_SENSITIVE`.
|
|
137
|
+
* @returns `{ op: 'ends-with', field, value, stringComparison }`.
|
|
138
|
+
* @throws TypeError If `stringComparison` is not a {@link StringComparison}
|
|
139
|
+
* member, `field` is not a valid query field path, or `value` is not a string.
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* filter.endsWith('state.note', '.pdf', StringComparison.CASE_INSENSITIVE);
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
endsWith<FIELDS extends string>(field: FIELDS, value: string, stringComparison?: StringComparison): StringFilter<FIELDS>;
|
|
146
|
+
/**
|
|
147
|
+
* Matches records whose `field` equals one of `values`.
|
|
148
|
+
*
|
|
149
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
150
|
+
* @param values - Non-empty list of non-null JSON scalars.
|
|
151
|
+
* @returns `{ op: 'in', field, values }` with a copy of `values`.
|
|
152
|
+
* @throws TypeError If `values` is empty, contains `null` or `undefined`,
|
|
153
|
+
* or contains a value that is not a string, a boolean or a finite
|
|
154
|
+
* number, or if `field` is not a valid query field path.
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* filter.isIn('state.status', ['PAID', 'SHIPPED']);
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
isIn<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
|
|
161
|
+
/**
|
|
162
|
+
* Matches records whose `field` equals none of `values`.
|
|
163
|
+
*
|
|
164
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
165
|
+
* @param values - Non-empty list of non-null JSON scalars.
|
|
166
|
+
* @returns `{ op: 'not-in', field, values }` with a copy of `values`.
|
|
167
|
+
* @throws TypeError If `values` is empty, contains `null` or `undefined`,
|
|
168
|
+
* or contains a value that is not a string, a boolean or a finite
|
|
169
|
+
* number, or if `field` is not a valid query field path.
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* filter.notIn('state.status', ['CANCELLED', 'REFUNDED']);
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
notIn<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
|
|
176
|
+
/**
|
|
177
|
+
* Matches records whose array `field` contains every value in `values`.
|
|
178
|
+
*
|
|
179
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
180
|
+
* @param values - Non-empty list of non-null JSON scalars.
|
|
181
|
+
* @returns `{ op: 'contains-all', field, values }` with a copy of `values`.
|
|
182
|
+
* @throws TypeError If `values` is empty, contains `null` or `undefined`,
|
|
183
|
+
* or contains a value that is not a string, a boolean or a finite
|
|
184
|
+
* number, or if `field` is not a valid query field path.
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* filter.containsAll('access.teams', ['sales', 'support']);
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
containsAll<FIELDS extends string>(field: FIELDS, values: readonly ComparableFilterLiteral[]): CollectionFilter<FIELDS>;
|
|
191
|
+
/**
|
|
192
|
+
* Matches records whose `field` lies in the inclusive range
|
|
193
|
+
* `lowerBound <= field <= upperBound`.
|
|
194
|
+
*
|
|
195
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
196
|
+
* @param lowerBound - Inclusive lower bound; non-null JSON scalar.
|
|
197
|
+
* @param upperBound - Inclusive upper bound; non-null JSON scalar.
|
|
198
|
+
* @returns `{ op: 'between', field, lowerBound, upperBound }`.
|
|
199
|
+
* @throws TypeError If `field` is not a valid query field path, or either bound is not a
|
|
200
|
+
* string, a boolean or a finite number.
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* filter.between('state.total', 100, 200);
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
between<FIELDS extends string>(field: FIELDS, lowerBound: ComparableFilterLiteral, upperBound: ComparableFilterLiteral): BetweenFilter<FIELDS>;
|
|
207
|
+
/**
|
|
208
|
+
* Matches records whose array `field` is empty. On Elasticsearch it may also
|
|
209
|
+
* match a missing or `null` field.
|
|
210
|
+
*
|
|
211
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
212
|
+
* @returns `{ op: 'is-empty', field }`.
|
|
213
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* filter.isEmpty('state.items');
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
isEmpty<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
220
|
+
/**
|
|
221
|
+
* Matches records whose string `field` equals `""`. Whitespace-only
|
|
222
|
+
* strings do not match.
|
|
223
|
+
*
|
|
224
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
225
|
+
* @returns `{ op: 'is-empty-string', field }`.
|
|
226
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
227
|
+
* @example
|
|
228
|
+
* ```typescript
|
|
229
|
+
* filter.isEmptyString('state.note');
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
isEmptyString<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
233
|
+
/**
|
|
234
|
+
* Matches records whose string `field` exists, is not `null` and is not
|
|
235
|
+
* `""`.
|
|
236
|
+
*
|
|
237
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
238
|
+
* @returns `{ op: 'is-not-empty-string', field }`.
|
|
239
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
240
|
+
* @example
|
|
241
|
+
* ```typescript
|
|
242
|
+
* filter.isNotEmptyString('state.note');
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
isNotEmptyString<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
246
|
+
/**
|
|
247
|
+
* Matches records whose `field` is `null` or missing, following the
|
|
248
|
+
* backend's null semantics.
|
|
249
|
+
*
|
|
250
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
251
|
+
* @returns `{ op: 'is-null', field }`.
|
|
252
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
253
|
+
* @example
|
|
254
|
+
* ```typescript
|
|
255
|
+
* filter.isNull('state.note');
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
isNull<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
259
|
+
/**
|
|
260
|
+
* Matches records whose `field` exists and is not `null`, following the
|
|
261
|
+
* backend's null semantics.
|
|
262
|
+
*
|
|
263
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
264
|
+
* @returns `{ op: 'is-not-null', field }`.
|
|
265
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
266
|
+
* @example
|
|
267
|
+
* ```typescript
|
|
268
|
+
* filter.isNotNull('state.note');
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
isNotNull<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
272
|
+
/**
|
|
273
|
+
* Matches records where `field` exists. On MongoDB this includes a `null`
|
|
274
|
+
* value.
|
|
275
|
+
*
|
|
276
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
277
|
+
* @returns `{ op: 'exists', field }`.
|
|
278
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
279
|
+
* @example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* filter.exists('state.note');
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
exists<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
285
|
+
/**
|
|
286
|
+
* Matches records where `field` is missing.
|
|
287
|
+
*
|
|
288
|
+
* @param field - Query field path, e.g. `state.status`.
|
|
289
|
+
* @returns `{ op: 'not-exists', field }`.
|
|
290
|
+
* @throws TypeError If `field` is not a valid query field path.
|
|
291
|
+
* @example
|
|
292
|
+
* ```typescript
|
|
293
|
+
* filter.notExists('state.note');
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
notExists<FIELDS extends string>(field: FIELDS): FieldPresenceFilter<FIELDS>;
|
|
297
|
+
};
|