@cloudbase/database 1.4.0 → 1.4.1-alpha.0
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 +32 -10
- package/dist/commonjs/ObjectId/index.d.ts +11 -11
- package/dist/commonjs/ObjectId/index.js +21 -21
- package/dist/commonjs/aggregate.d.ts +29 -29
- package/dist/commonjs/aggregate.js +124 -124
- package/dist/commonjs/collection.d.ts +17 -17
- package/dist/commonjs/collection.js +72 -72
- package/dist/commonjs/command.d.ts +175 -175
- package/dist/commonjs/command.js +285 -285
- package/dist/commonjs/commands/logic.d.ts +24 -24
- package/dist/commonjs/commands/logic.js +79 -79
- package/dist/commonjs/commands/query.d.ts +73 -73
- package/dist/commonjs/commands/query.js +147 -147
- package/dist/commonjs/commands/update.d.ts +29 -29
- package/dist/commonjs/commands/update.js +49 -49
- package/dist/commonjs/config/app.config.d.ts +6 -6
- package/dist/commonjs/config/app.config.js +7 -7
- package/dist/commonjs/config/error.config.d.ts +3 -3
- package/dist/commonjs/config/error.config.js +15 -15
- package/dist/commonjs/const/code.d.ts +34 -34
- package/dist/commonjs/const/code.js +36 -36
- package/dist/commonjs/constant.d.ts +54 -54
- package/dist/commonjs/constant.js +76 -76
- package/dist/commonjs/document.d.ts +14 -14
- package/dist/commonjs/document.js +219 -219
- package/dist/commonjs/geo/index.d.ts +6 -6
- package/dist/commonjs/geo/index.js +11 -11
- package/dist/commonjs/geo/interface.d.ts +24 -24
- package/dist/commonjs/geo/interface.js +2 -2
- package/dist/commonjs/geo/lineString.d.ts +19 -19
- package/dist/commonjs/geo/lineString.js +57 -57
- package/dist/commonjs/geo/multiLineString.d.ts +18 -18
- package/dist/commonjs/geo/multiLineString.js +56 -56
- package/dist/commonjs/geo/multiPoint.d.ts +18 -18
- package/dist/commonjs/geo/multiPoint.js +50 -50
- package/dist/commonjs/geo/multiPolygon.d.ts +18 -18
- package/dist/commonjs/geo/multiPolygon.js +62 -62
- package/dist/commonjs/geo/point.d.ts +19 -19
- package/dist/commonjs/geo/point.js +43 -43
- package/dist/commonjs/geo/polygon.d.ts +19 -19
- package/dist/commonjs/geo/polygon.js +70 -70
- package/dist/commonjs/helper/symbol.d.ts +15 -15
- package/dist/commonjs/helper/symbol.js +20 -20
- package/dist/commonjs/index.d.ts +50 -50
- package/dist/commonjs/index.js +41 -41
- package/dist/commonjs/operator-map.d.ts +4 -4
- package/dist/commonjs/operator-map.js +23 -23
- package/dist/commonjs/query.d.ts +38 -38
- package/dist/commonjs/query.js +247 -247
- package/dist/commonjs/realtime/error.d.ts +7 -7
- package/dist/commonjs/realtime/error.js +11 -11
- package/dist/commonjs/realtime/listener.d.ts +14 -14
- package/dist/commonjs/realtime/listener.js +17 -17
- package/dist/commonjs/realtime/message.d.ts +3 -3
- package/dist/commonjs/realtime/message.js +10 -10
- package/dist/commonjs/realtime/snapshot.d.ts +16 -16
- package/dist/commonjs/realtime/snapshot.js +42 -42
- package/dist/commonjs/realtime/virtual-websocket-client.d.ts +63 -63
- package/dist/commonjs/realtime/virtual-websocket-client.js +736 -736
- package/dist/commonjs/realtime/websocket-client.d.ts +78 -78
- package/dist/commonjs/realtime/websocket-client.js +567 -567
- package/dist/commonjs/realtime/ws-event.d.ts +126 -126
- package/dist/commonjs/realtime/ws-event.js +139 -139
- package/dist/commonjs/regexp/index.d.ts +18 -18
- package/dist/commonjs/regexp/index.js +30 -30
- package/dist/commonjs/serializer/common.d.ts +11 -11
- package/dist/commonjs/serializer/common.js +90 -90
- package/dist/commonjs/serializer/datatype.d.ts +7 -7
- package/dist/commonjs/serializer/datatype.js +99 -99
- package/dist/commonjs/serializer/query.d.ts +8 -8
- package/dist/commonjs/serializer/query.js +254 -254
- package/dist/commonjs/serializer/update.d.ts +16 -16
- package/dist/commonjs/serializer/update.js +142 -142
- package/dist/commonjs/serverDate/index.d.ts +13 -13
- package/dist/commonjs/serverDate/index.js +23 -23
- package/dist/commonjs/transaction/index.d.ts +30 -30
- package/dist/commonjs/transaction/index.js +105 -105
- package/dist/commonjs/transaction.d.ts +42 -42
- package/dist/commonjs/transaction.js +126 -126
- package/dist/commonjs/typings/index.d.ts +45 -45
- package/dist/commonjs/typings/index.js +2 -2
- package/dist/commonjs/typings/realtime.d.ts +219 -219
- package/dist/commonjs/typings/realtime.js +2 -2
- package/dist/commonjs/util.d.ts +9 -9
- package/dist/commonjs/util.js +101 -101
- package/dist/commonjs/utils/error.d.ts +37 -37
- package/dist/commonjs/utils/error.js +55 -55
- package/dist/commonjs/utils/symbol.d.ts +8 -8
- package/dist/commonjs/utils/symbol.js +39 -39
- package/dist/commonjs/utils/type.d.ts +13 -13
- package/dist/commonjs/utils/type.js +22 -22
- package/dist/commonjs/utils/utils.d.ts +19 -19
- package/dist/commonjs/utils/utils.js +59 -59
- package/dist/commonjs/validate.d.ts +1 -1
- package/dist/commonjs/validate.js +155 -155
- package/dist/esm/ObjectId/index.d.ts +11 -11
- package/dist/esm/ObjectId/index.js +17 -17
- package/dist/esm/aggregate.d.ts +29 -29
- package/dist/esm/aggregate.js +121 -121
- package/dist/esm/collection.d.ts +17 -17
- package/dist/esm/collection.js +69 -69
- package/dist/esm/command.d.ts +175 -175
- package/dist/esm/command.js +281 -281
- package/dist/esm/commands/logic.d.ts +24 -24
- package/dist/esm/commands/logic.js +74 -74
- package/dist/esm/commands/query.d.ts +73 -73
- package/dist/esm/commands/query.js +141 -141
- package/dist/esm/commands/update.d.ts +29 -29
- package/dist/esm/commands/update.js +44 -44
- package/dist/esm/config/app.config.d.ts +6 -6
- package/dist/esm/config/app.config.js +5 -5
- package/dist/esm/config/error.config.d.ts +3 -3
- package/dist/esm/config/error.config.js +13 -13
- package/dist/esm/const/code.d.ts +34 -34
- package/dist/esm/const/code.js +34 -34
- package/dist/esm/constant.d.ts +54 -54
- package/dist/esm/constant.js +67 -67
- package/dist/esm/document.d.ts +14 -14
- package/dist/esm/document.js +216 -216
- package/dist/esm/geo/index.d.ts +6 -6
- package/dist/esm/geo/index.js +6 -6
- package/dist/esm/geo/interface.d.ts +24 -24
- package/dist/esm/geo/lineString.d.ts +19 -19
- package/dist/esm/geo/lineString.js +54 -54
- package/dist/esm/geo/multiLineString.d.ts +18 -18
- package/dist/esm/geo/multiLineString.js +53 -53
- package/dist/esm/geo/multiPoint.d.ts +18 -18
- package/dist/esm/geo/multiPoint.js +47 -47
- package/dist/esm/geo/multiPolygon.d.ts +18 -18
- package/dist/esm/geo/multiPolygon.js +59 -59
- package/dist/esm/geo/point.d.ts +19 -19
- package/dist/esm/geo/point.js +40 -40
- package/dist/esm/geo/polygon.d.ts +19 -19
- package/dist/esm/geo/polygon.js +67 -67
- package/dist/esm/helper/symbol.d.ts +15 -15
- package/dist/esm/helper/symbol.js +15 -15
- package/dist/esm/index.d.ts +50 -50
- package/dist/esm/index.js +35 -35
- package/dist/esm/operator-map.d.ts +4 -4
- package/dist/esm/operator-map.js +20 -20
- package/dist/esm/query.d.ts +38 -38
- package/dist/esm/query.js +244 -244
- package/dist/esm/realtime/error.d.ts +7 -7
- package/dist/esm/realtime/error.js +8 -8
- package/dist/esm/realtime/listener.d.ts +14 -14
- package/dist/esm/realtime/listener.js +14 -14
- package/dist/esm/realtime/message.d.ts +3 -3
- package/dist/esm/realtime/message.js +6 -6
- package/dist/esm/realtime/snapshot.d.ts +16 -16
- package/dist/esm/realtime/snapshot.js +39 -39
- package/dist/esm/realtime/virtual-websocket-client.d.ts +63 -63
- package/dist/esm/realtime/virtual-websocket-client.js +733 -733
- package/dist/esm/realtime/websocket-client.d.ts +78 -78
- package/dist/esm/realtime/websocket-client.js +564 -564
- package/dist/esm/realtime/ws-event.d.ts +126 -126
- package/dist/esm/realtime/ws-event.js +137 -137
- package/dist/esm/regexp/index.d.ts +18 -18
- package/dist/esm/regexp/index.js +26 -26
- package/dist/esm/serializer/common.d.ts +11 -11
- package/dist/esm/serializer/common.js +82 -82
- package/dist/esm/serializer/datatype.d.ts +7 -7
- package/dist/esm/serializer/datatype.js +95 -95
- package/dist/esm/serializer/query.d.ts +8 -8
- package/dist/esm/serializer/query.js +251 -251
- package/dist/esm/serializer/update.d.ts +16 -16
- package/dist/esm/serializer/update.js +139 -139
- package/dist/esm/serverDate/index.d.ts +13 -13
- package/dist/esm/serverDate/index.js +19 -19
- package/dist/esm/transaction/index.d.ts +30 -30
- package/dist/esm/transaction/index.js +100 -100
- package/dist/esm/transaction.d.ts +42 -42
- package/dist/esm/transaction.js +121 -121
- package/dist/esm/typings/index.d.ts +45 -45
- package/dist/esm/typings/realtime.d.ts +219 -219
- package/dist/esm/util.d.ts +9 -9
- package/dist/esm/util.js +98 -98
- package/dist/esm/utils/error.d.ts +37 -37
- package/dist/esm/utils/error.js +49 -49
- package/dist/esm/utils/symbol.d.ts +8 -8
- package/dist/esm/utils/symbol.js +36 -36
- package/dist/esm/utils/type.d.ts +13 -13
- package/dist/esm/utils/type.js +20 -20
- package/dist/esm/utils/utils.d.ts +19 -19
- package/dist/esm/utils/utils.js +55 -55
- package/dist/esm/validate.d.ts +1 -1
- package/dist/esm/validate.js +152 -152
- package/package.json +1 -1
- package/src/aggregate.ts +8 -5
- package/dist/commonjs/decimal128/index.d.ts +0 -8
- package/dist/commonjs/decimal128/index.js +0 -26
- package/dist/commonjs/lib/util.d.ts +0 -1
- package/dist/commonjs/lib/util.js +0 -25
- package/dist/commonjs/transaction/collection.d.ts +0 -7
- package/dist/commonjs/transaction/collection.js +0 -46
- package/dist/commonjs/transaction/document.d.ts +0 -27
- package/dist/commonjs/transaction/document.js +0 -205
- package/dist/commonjs/transaction/query.d.ts +0 -5
- package/dist/commonjs/transaction/query.js +0 -10
- package/dist/esm/lib/util.d.ts +0 -1
- package/dist/esm/lib/util.js +0 -23
- package/dist/esm/transaction/collection.d.ts +0 -7
- package/dist/esm/transaction/collection.js +0 -44
- package/dist/esm/transaction/document.d.ts +0 -27
- package/dist/esm/transaction/document.js +0 -203
- package/dist/esm/transaction/query.d.ts +0 -5
- package/dist/esm/transaction/query.js +0 -8
package/dist/esm/command.js
CHANGED
|
@@ -1,281 +1,281 @@
|
|
|
1
|
-
import { QueryCommand, QUERY_COMMANDS_LITERAL } from './commands/query';
|
|
2
|
-
import { LogicCommand, LOGIC_COMMANDS_LITERAL } from './commands/logic';
|
|
3
|
-
import { UpdateCommand, UPDATE_COMMANDS_LITERAL } from './commands/update';
|
|
4
|
-
import { isArray, isObject, isString } from './utils/type';
|
|
5
|
-
import Aggregation from './aggregate';
|
|
6
|
-
export const Command = {
|
|
7
|
-
eq(val) {
|
|
8
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.EQ, [val]);
|
|
9
|
-
},
|
|
10
|
-
neq(val) {
|
|
11
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.NEQ, [val]);
|
|
12
|
-
},
|
|
13
|
-
lt(val) {
|
|
14
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.LT, [val]);
|
|
15
|
-
},
|
|
16
|
-
lte(val) {
|
|
17
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.LTE, [val]);
|
|
18
|
-
},
|
|
19
|
-
gt(val) {
|
|
20
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.GT, [val]);
|
|
21
|
-
},
|
|
22
|
-
gte(val) {
|
|
23
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.GTE, [val]);
|
|
24
|
-
},
|
|
25
|
-
in(val) {
|
|
26
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.IN, val);
|
|
27
|
-
},
|
|
28
|
-
nin(val) {
|
|
29
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.NIN, val);
|
|
30
|
-
},
|
|
31
|
-
all(val) {
|
|
32
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.ALL, val);
|
|
33
|
-
},
|
|
34
|
-
elemMatch(val) {
|
|
35
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.ELEM_MATCH, [val]);
|
|
36
|
-
},
|
|
37
|
-
exists(val) {
|
|
38
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.EXISTS, [val]);
|
|
39
|
-
},
|
|
40
|
-
size(val) {
|
|
41
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.SIZE, [val]);
|
|
42
|
-
},
|
|
43
|
-
mod() {
|
|
44
|
-
if (arguments.length == 1)
|
|
45
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.MOD, [arguments[0]]);
|
|
46
|
-
if (arguments.length == 2)
|
|
47
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.MOD, [[arguments[0], arguments[1]]]);
|
|
48
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.MOD, arguments);
|
|
49
|
-
},
|
|
50
|
-
geoNear(val) {
|
|
51
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_NEAR, [val]);
|
|
52
|
-
},
|
|
53
|
-
geoWithin(val) {
|
|
54
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_WITHIN, [val]);
|
|
55
|
-
},
|
|
56
|
-
geoIntersects(val) {
|
|
57
|
-
return new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_INTERSECTS, [val]);
|
|
58
|
-
},
|
|
59
|
-
and(...__expressions__) {
|
|
60
|
-
const expressions = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
61
|
-
return new LogicCommand(LOGIC_COMMANDS_LITERAL.AND, expressions);
|
|
62
|
-
},
|
|
63
|
-
nor(...__expressions__) {
|
|
64
|
-
const expressions = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
65
|
-
return new LogicCommand(LOGIC_COMMANDS_LITERAL.NOR, expressions);
|
|
66
|
-
},
|
|
67
|
-
or(...__expressions__) {
|
|
68
|
-
const expressions = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
69
|
-
return new LogicCommand(LOGIC_COMMANDS_LITERAL.OR, expressions);
|
|
70
|
-
},
|
|
71
|
-
not(...__expressions__) {
|
|
72
|
-
const expressions = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
73
|
-
return new LogicCommand(LOGIC_COMMANDS_LITERAL.NOT, expressions);
|
|
74
|
-
},
|
|
75
|
-
set(val) {
|
|
76
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.SET, [val]);
|
|
77
|
-
},
|
|
78
|
-
remove() {
|
|
79
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.REMOVE, []);
|
|
80
|
-
},
|
|
81
|
-
inc(val) {
|
|
82
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.INC, [val]);
|
|
83
|
-
},
|
|
84
|
-
mul(val) {
|
|
85
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.MUL, [val]);
|
|
86
|
-
},
|
|
87
|
-
push(...args) {
|
|
88
|
-
let values;
|
|
89
|
-
if (isObject(args[0]) && args[0].hasOwnProperty('each')) {
|
|
90
|
-
values = {};
|
|
91
|
-
const options = args[0];
|
|
92
|
-
if (options.each !== undefined) {
|
|
93
|
-
values['$each'] = options.each;
|
|
94
|
-
}
|
|
95
|
-
if (options.position !== undefined) {
|
|
96
|
-
values['$position'] = options.position;
|
|
97
|
-
}
|
|
98
|
-
if (options.sort !== undefined) {
|
|
99
|
-
values['$sort'] = options.sort;
|
|
100
|
-
}
|
|
101
|
-
if (options.slice !== undefined) {
|
|
102
|
-
values['$slice'] = options.slice;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
else if (isArray(args[0])) {
|
|
106
|
-
values = args[0];
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
values = Array.from(args);
|
|
110
|
-
}
|
|
111
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.PUSH, values);
|
|
112
|
-
},
|
|
113
|
-
pull(values) {
|
|
114
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.PULL, values);
|
|
115
|
-
},
|
|
116
|
-
pullAll(values) {
|
|
117
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.PULL_ALL, values);
|
|
118
|
-
},
|
|
119
|
-
pop() {
|
|
120
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.POP, []);
|
|
121
|
-
},
|
|
122
|
-
shift() {
|
|
123
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.SHIFT, []);
|
|
124
|
-
},
|
|
125
|
-
unshift(...__values__) {
|
|
126
|
-
const values = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
127
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.UNSHIFT, values);
|
|
128
|
-
},
|
|
129
|
-
addToSet(values) {
|
|
130
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.ADD_TO_SET, values);
|
|
131
|
-
},
|
|
132
|
-
rename(values) {
|
|
133
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.RENAME, [values]);
|
|
134
|
-
},
|
|
135
|
-
bit(values) {
|
|
136
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.BIT, [values]);
|
|
137
|
-
},
|
|
138
|
-
max(values) {
|
|
139
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.MAX, [values]);
|
|
140
|
-
},
|
|
141
|
-
min(values) {
|
|
142
|
-
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.MIN, [values]);
|
|
143
|
-
},
|
|
144
|
-
expr(values) {
|
|
145
|
-
return {
|
|
146
|
-
$expr: values
|
|
147
|
-
};
|
|
148
|
-
},
|
|
149
|
-
jsonSchema(schema) {
|
|
150
|
-
return {
|
|
151
|
-
$jsonSchema: schema
|
|
152
|
-
};
|
|
153
|
-
},
|
|
154
|
-
text(values) {
|
|
155
|
-
if (isString(values)) {
|
|
156
|
-
return {
|
|
157
|
-
$search: values.search
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
return {
|
|
162
|
-
$search: values.search,
|
|
163
|
-
$language: values.language,
|
|
164
|
-
$caseSensitive: values.caseSensitive,
|
|
165
|
-
$diacriticSensitive: values.diacriticSensitive
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
aggregate: {
|
|
170
|
-
pipeline() {
|
|
171
|
-
return new Aggregation();
|
|
172
|
-
},
|
|
173
|
-
abs: param => new AggregationOperator('abs', param),
|
|
174
|
-
add: param => new AggregationOperator('add', param),
|
|
175
|
-
ceil: param => new AggregationOperator('ceil', param),
|
|
176
|
-
divide: param => new AggregationOperator('divide', param),
|
|
177
|
-
exp: param => new AggregationOperator('exp', param),
|
|
178
|
-
floor: param => new AggregationOperator('floor', param),
|
|
179
|
-
ln: param => new AggregationOperator('ln', param),
|
|
180
|
-
log: param => new AggregationOperator('log', param),
|
|
181
|
-
log10: param => new AggregationOperator('log10', param),
|
|
182
|
-
mod: param => new AggregationOperator('mod', param),
|
|
183
|
-
multiply: param => new AggregationOperator('multiply', param),
|
|
184
|
-
pow: param => new AggregationOperator('pow', param),
|
|
185
|
-
sqrt: param => new AggregationOperator('sqrt', param),
|
|
186
|
-
subtract: param => new AggregationOperator('subtract', param),
|
|
187
|
-
trunc: param => new AggregationOperator('trunc', param),
|
|
188
|
-
arrayElemAt: param => new AggregationOperator('arrayElemAt', param),
|
|
189
|
-
arrayToObject: param => new AggregationOperator('arrayToObject', param),
|
|
190
|
-
concatArrays: param => new AggregationOperator('concatArrays', param),
|
|
191
|
-
filter: param => new AggregationOperator('filter', param),
|
|
192
|
-
in: param => new AggregationOperator('in', param),
|
|
193
|
-
indexOfArray: param => new AggregationOperator('indexOfArray', param),
|
|
194
|
-
isArray: param => new AggregationOperator('isArray', param),
|
|
195
|
-
map: param => new AggregationOperator('map', param),
|
|
196
|
-
range: param => new AggregationOperator('range', param),
|
|
197
|
-
reduce: param => new AggregationOperator('reduce', param),
|
|
198
|
-
reverseArray: param => new AggregationOperator('reverseArray', param),
|
|
199
|
-
size: param => new AggregationOperator('size', param),
|
|
200
|
-
slice: param => new AggregationOperator('slice', param),
|
|
201
|
-
zip: param => new AggregationOperator('zip', param),
|
|
202
|
-
and: param => new AggregationOperator('and', param),
|
|
203
|
-
not: param => new AggregationOperator('not', param),
|
|
204
|
-
or: param => new AggregationOperator('or', param),
|
|
205
|
-
cmp: param => new AggregationOperator('cmp', param),
|
|
206
|
-
eq: param => new AggregationOperator('eq', param),
|
|
207
|
-
gt: param => new AggregationOperator('gt', param),
|
|
208
|
-
gte: param => new AggregationOperator('gte', param),
|
|
209
|
-
lt: param => new AggregationOperator('lt', param),
|
|
210
|
-
lte: param => new AggregationOperator('lte', param),
|
|
211
|
-
neq: param => new AggregationOperator('ne', param),
|
|
212
|
-
cond: param => new AggregationOperator('cond', param),
|
|
213
|
-
ifNull: param => new AggregationOperator('ifNull', param),
|
|
214
|
-
switch: param => new AggregationOperator('switch', param),
|
|
215
|
-
dateFromParts: param => new AggregationOperator('dateFromParts', param),
|
|
216
|
-
dateFromString: param => new AggregationOperator('dateFromString', param),
|
|
217
|
-
dayOfMonth: param => new AggregationOperator('dayOfMonth', param),
|
|
218
|
-
dayOfWeek: param => new AggregationOperator('dayOfWeek', param),
|
|
219
|
-
dayOfYear: param => new AggregationOperator('dayOfYear', param),
|
|
220
|
-
isoDayOfWeek: param => new AggregationOperator('isoDayOfWeek', param),
|
|
221
|
-
isoWeek: param => new AggregationOperator('isoWeek', param),
|
|
222
|
-
isoWeekYear: param => new AggregationOperator('isoWeekYear', param),
|
|
223
|
-
millisecond: param => new AggregationOperator('millisecond', param),
|
|
224
|
-
minute: param => new AggregationOperator('minute', param),
|
|
225
|
-
month: param => new AggregationOperator('month', param),
|
|
226
|
-
second: param => new AggregationOperator('second', param),
|
|
227
|
-
hour: param => new AggregationOperator('hour', param),
|
|
228
|
-
week: param => new AggregationOperator('week', param),
|
|
229
|
-
year: param => new AggregationOperator('year', param),
|
|
230
|
-
literal: param => new AggregationOperator('literal', param),
|
|
231
|
-
mergeObjects: param => new AggregationOperator('mergeObjects', param),
|
|
232
|
-
objectToArray: param => new AggregationOperator('objectToArray', param),
|
|
233
|
-
allElementsTrue: param => new AggregationOperator('allElementsTrue', param),
|
|
234
|
-
anyElementTrue: param => new AggregationOperator('anyElementTrue', param),
|
|
235
|
-
setDifference: param => new AggregationOperator('setDifference', param),
|
|
236
|
-
setEquals: param => new AggregationOperator('setEquals', param),
|
|
237
|
-
setIntersection: param => new AggregationOperator('setIntersection', param),
|
|
238
|
-
setIsSubset: param => new AggregationOperator('setIsSubset', param),
|
|
239
|
-
setUnion: param => new AggregationOperator('setUnion', param),
|
|
240
|
-
concat: param => new AggregationOperator('concat', param),
|
|
241
|
-
dateToString: param => new AggregationOperator('dateToString', param),
|
|
242
|
-
indexOfBytes: param => new AggregationOperator('indexOfBytes', param),
|
|
243
|
-
indexOfCP: param => new AggregationOperator('indexOfCP', param),
|
|
244
|
-
split: param => new AggregationOperator('split', param),
|
|
245
|
-
strLenBytes: param => new AggregationOperator('strLenBytes', param),
|
|
246
|
-
strLenCP: param => new AggregationOperator('strLenCP', param),
|
|
247
|
-
strcasecmp: param => new AggregationOperator('strcasecmp', param),
|
|
248
|
-
substr: param => new AggregationOperator('substr', param),
|
|
249
|
-
substrBytes: param => new AggregationOperator('substrBytes', param),
|
|
250
|
-
substrCP: param => new AggregationOperator('substrCP', param),
|
|
251
|
-
toLower: param => new AggregationOperator('toLower', param),
|
|
252
|
-
toUpper: param => new AggregationOperator('toUpper', param),
|
|
253
|
-
meta: param => new AggregationOperator('meta', param),
|
|
254
|
-
addToSet: param => new AggregationOperator('addToSet', param),
|
|
255
|
-
avg: param => new AggregationOperator('avg', param),
|
|
256
|
-
first: param => new AggregationOperator('first', param),
|
|
257
|
-
last: param => new AggregationOperator('last', param),
|
|
258
|
-
max: param => new AggregationOperator('max', param),
|
|
259
|
-
min: param => new AggregationOperator('min', param),
|
|
260
|
-
push: param => new AggregationOperator('push', param),
|
|
261
|
-
stdDevPop: param => new AggregationOperator('stdDevPop', param),
|
|
262
|
-
stdDevSamp: param => new AggregationOperator('stdDevSamp', param),
|
|
263
|
-
sum: param => new AggregationOperator('sum', param),
|
|
264
|
-
let: param => new AggregationOperator('let', param)
|
|
265
|
-
},
|
|
266
|
-
project: {
|
|
267
|
-
slice: param => new ProjectionOperator('slice', param),
|
|
268
|
-
elemMatch: param => new ProjectionOperator('elemMatch', param)
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
export class AggregationOperator {
|
|
272
|
-
constructor(name, param) {
|
|
273
|
-
this['$' + name] = param;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
export class ProjectionOperator {
|
|
277
|
-
constructor(name, param) {
|
|
278
|
-
this['$' + name] = param;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
export default Command;
|
|
1
|
+
import { QueryCommand, QUERY_COMMANDS_LITERAL } from './commands/query';
|
|
2
|
+
import { LogicCommand, LOGIC_COMMANDS_LITERAL } from './commands/logic';
|
|
3
|
+
import { UpdateCommand, UPDATE_COMMANDS_LITERAL } from './commands/update';
|
|
4
|
+
import { isArray, isObject, isString } from './utils/type';
|
|
5
|
+
import Aggregation from './aggregate';
|
|
6
|
+
export const Command = {
|
|
7
|
+
eq(val) {
|
|
8
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.EQ, [val]);
|
|
9
|
+
},
|
|
10
|
+
neq(val) {
|
|
11
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.NEQ, [val]);
|
|
12
|
+
},
|
|
13
|
+
lt(val) {
|
|
14
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.LT, [val]);
|
|
15
|
+
},
|
|
16
|
+
lte(val) {
|
|
17
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.LTE, [val]);
|
|
18
|
+
},
|
|
19
|
+
gt(val) {
|
|
20
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.GT, [val]);
|
|
21
|
+
},
|
|
22
|
+
gte(val) {
|
|
23
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.GTE, [val]);
|
|
24
|
+
},
|
|
25
|
+
in(val) {
|
|
26
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.IN, val);
|
|
27
|
+
},
|
|
28
|
+
nin(val) {
|
|
29
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.NIN, val);
|
|
30
|
+
},
|
|
31
|
+
all(val) {
|
|
32
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.ALL, val);
|
|
33
|
+
},
|
|
34
|
+
elemMatch(val) {
|
|
35
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.ELEM_MATCH, [val]);
|
|
36
|
+
},
|
|
37
|
+
exists(val) {
|
|
38
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.EXISTS, [val]);
|
|
39
|
+
},
|
|
40
|
+
size(val) {
|
|
41
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.SIZE, [val]);
|
|
42
|
+
},
|
|
43
|
+
mod() {
|
|
44
|
+
if (arguments.length == 1)
|
|
45
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.MOD, [arguments[0]]);
|
|
46
|
+
if (arguments.length == 2)
|
|
47
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.MOD, [[arguments[0], arguments[1]]]);
|
|
48
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.MOD, arguments);
|
|
49
|
+
},
|
|
50
|
+
geoNear(val) {
|
|
51
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_NEAR, [val]);
|
|
52
|
+
},
|
|
53
|
+
geoWithin(val) {
|
|
54
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_WITHIN, [val]);
|
|
55
|
+
},
|
|
56
|
+
geoIntersects(val) {
|
|
57
|
+
return new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_INTERSECTS, [val]);
|
|
58
|
+
},
|
|
59
|
+
and(...__expressions__) {
|
|
60
|
+
const expressions = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
61
|
+
return new LogicCommand(LOGIC_COMMANDS_LITERAL.AND, expressions);
|
|
62
|
+
},
|
|
63
|
+
nor(...__expressions__) {
|
|
64
|
+
const expressions = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
65
|
+
return new LogicCommand(LOGIC_COMMANDS_LITERAL.NOR, expressions);
|
|
66
|
+
},
|
|
67
|
+
or(...__expressions__) {
|
|
68
|
+
const expressions = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
69
|
+
return new LogicCommand(LOGIC_COMMANDS_LITERAL.OR, expressions);
|
|
70
|
+
},
|
|
71
|
+
not(...__expressions__) {
|
|
72
|
+
const expressions = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
73
|
+
return new LogicCommand(LOGIC_COMMANDS_LITERAL.NOT, expressions);
|
|
74
|
+
},
|
|
75
|
+
set(val) {
|
|
76
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.SET, [val]);
|
|
77
|
+
},
|
|
78
|
+
remove() {
|
|
79
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.REMOVE, []);
|
|
80
|
+
},
|
|
81
|
+
inc(val) {
|
|
82
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.INC, [val]);
|
|
83
|
+
},
|
|
84
|
+
mul(val) {
|
|
85
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.MUL, [val]);
|
|
86
|
+
},
|
|
87
|
+
push(...args) {
|
|
88
|
+
let values;
|
|
89
|
+
if (isObject(args[0]) && args[0].hasOwnProperty('each')) {
|
|
90
|
+
values = {};
|
|
91
|
+
const options = args[0];
|
|
92
|
+
if (options.each !== undefined) {
|
|
93
|
+
values['$each'] = options.each;
|
|
94
|
+
}
|
|
95
|
+
if (options.position !== undefined) {
|
|
96
|
+
values['$position'] = options.position;
|
|
97
|
+
}
|
|
98
|
+
if (options.sort !== undefined) {
|
|
99
|
+
values['$sort'] = options.sort;
|
|
100
|
+
}
|
|
101
|
+
if (options.slice !== undefined) {
|
|
102
|
+
values['$slice'] = options.slice;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else if (isArray(args[0])) {
|
|
106
|
+
values = args[0];
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
values = Array.from(args);
|
|
110
|
+
}
|
|
111
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.PUSH, values);
|
|
112
|
+
},
|
|
113
|
+
pull(values) {
|
|
114
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.PULL, values);
|
|
115
|
+
},
|
|
116
|
+
pullAll(values) {
|
|
117
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.PULL_ALL, values);
|
|
118
|
+
},
|
|
119
|
+
pop() {
|
|
120
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.POP, []);
|
|
121
|
+
},
|
|
122
|
+
shift() {
|
|
123
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.SHIFT, []);
|
|
124
|
+
},
|
|
125
|
+
unshift(...__values__) {
|
|
126
|
+
const values = isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
|
|
127
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.UNSHIFT, values);
|
|
128
|
+
},
|
|
129
|
+
addToSet(values) {
|
|
130
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.ADD_TO_SET, values);
|
|
131
|
+
},
|
|
132
|
+
rename(values) {
|
|
133
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.RENAME, [values]);
|
|
134
|
+
},
|
|
135
|
+
bit(values) {
|
|
136
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.BIT, [values]);
|
|
137
|
+
},
|
|
138
|
+
max(values) {
|
|
139
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.MAX, [values]);
|
|
140
|
+
},
|
|
141
|
+
min(values) {
|
|
142
|
+
return new UpdateCommand(UPDATE_COMMANDS_LITERAL.MIN, [values]);
|
|
143
|
+
},
|
|
144
|
+
expr(values) {
|
|
145
|
+
return {
|
|
146
|
+
$expr: values
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
jsonSchema(schema) {
|
|
150
|
+
return {
|
|
151
|
+
$jsonSchema: schema
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
text(values) {
|
|
155
|
+
if (isString(values)) {
|
|
156
|
+
return {
|
|
157
|
+
$search: values.search
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
return {
|
|
162
|
+
$search: values.search,
|
|
163
|
+
$language: values.language,
|
|
164
|
+
$caseSensitive: values.caseSensitive,
|
|
165
|
+
$diacriticSensitive: values.diacriticSensitive
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
aggregate: {
|
|
170
|
+
pipeline() {
|
|
171
|
+
return new Aggregation();
|
|
172
|
+
},
|
|
173
|
+
abs: param => new AggregationOperator('abs', param),
|
|
174
|
+
add: param => new AggregationOperator('add', param),
|
|
175
|
+
ceil: param => new AggregationOperator('ceil', param),
|
|
176
|
+
divide: param => new AggregationOperator('divide', param),
|
|
177
|
+
exp: param => new AggregationOperator('exp', param),
|
|
178
|
+
floor: param => new AggregationOperator('floor', param),
|
|
179
|
+
ln: param => new AggregationOperator('ln', param),
|
|
180
|
+
log: param => new AggregationOperator('log', param),
|
|
181
|
+
log10: param => new AggregationOperator('log10', param),
|
|
182
|
+
mod: param => new AggregationOperator('mod', param),
|
|
183
|
+
multiply: param => new AggregationOperator('multiply', param),
|
|
184
|
+
pow: param => new AggregationOperator('pow', param),
|
|
185
|
+
sqrt: param => new AggregationOperator('sqrt', param),
|
|
186
|
+
subtract: param => new AggregationOperator('subtract', param),
|
|
187
|
+
trunc: param => new AggregationOperator('trunc', param),
|
|
188
|
+
arrayElemAt: param => new AggregationOperator('arrayElemAt', param),
|
|
189
|
+
arrayToObject: param => new AggregationOperator('arrayToObject', param),
|
|
190
|
+
concatArrays: param => new AggregationOperator('concatArrays', param),
|
|
191
|
+
filter: param => new AggregationOperator('filter', param),
|
|
192
|
+
in: param => new AggregationOperator('in', param),
|
|
193
|
+
indexOfArray: param => new AggregationOperator('indexOfArray', param),
|
|
194
|
+
isArray: param => new AggregationOperator('isArray', param),
|
|
195
|
+
map: param => new AggregationOperator('map', param),
|
|
196
|
+
range: param => new AggregationOperator('range', param),
|
|
197
|
+
reduce: param => new AggregationOperator('reduce', param),
|
|
198
|
+
reverseArray: param => new AggregationOperator('reverseArray', param),
|
|
199
|
+
size: param => new AggregationOperator('size', param),
|
|
200
|
+
slice: param => new AggregationOperator('slice', param),
|
|
201
|
+
zip: param => new AggregationOperator('zip', param),
|
|
202
|
+
and: param => new AggregationOperator('and', param),
|
|
203
|
+
not: param => new AggregationOperator('not', param),
|
|
204
|
+
or: param => new AggregationOperator('or', param),
|
|
205
|
+
cmp: param => new AggregationOperator('cmp', param),
|
|
206
|
+
eq: param => new AggregationOperator('eq', param),
|
|
207
|
+
gt: param => new AggregationOperator('gt', param),
|
|
208
|
+
gte: param => new AggregationOperator('gte', param),
|
|
209
|
+
lt: param => new AggregationOperator('lt', param),
|
|
210
|
+
lte: param => new AggregationOperator('lte', param),
|
|
211
|
+
neq: param => new AggregationOperator('ne', param),
|
|
212
|
+
cond: param => new AggregationOperator('cond', param),
|
|
213
|
+
ifNull: param => new AggregationOperator('ifNull', param),
|
|
214
|
+
switch: param => new AggregationOperator('switch', param),
|
|
215
|
+
dateFromParts: param => new AggregationOperator('dateFromParts', param),
|
|
216
|
+
dateFromString: param => new AggregationOperator('dateFromString', param),
|
|
217
|
+
dayOfMonth: param => new AggregationOperator('dayOfMonth', param),
|
|
218
|
+
dayOfWeek: param => new AggregationOperator('dayOfWeek', param),
|
|
219
|
+
dayOfYear: param => new AggregationOperator('dayOfYear', param),
|
|
220
|
+
isoDayOfWeek: param => new AggregationOperator('isoDayOfWeek', param),
|
|
221
|
+
isoWeek: param => new AggregationOperator('isoWeek', param),
|
|
222
|
+
isoWeekYear: param => new AggregationOperator('isoWeekYear', param),
|
|
223
|
+
millisecond: param => new AggregationOperator('millisecond', param),
|
|
224
|
+
minute: param => new AggregationOperator('minute', param),
|
|
225
|
+
month: param => new AggregationOperator('month', param),
|
|
226
|
+
second: param => new AggregationOperator('second', param),
|
|
227
|
+
hour: param => new AggregationOperator('hour', param),
|
|
228
|
+
week: param => new AggregationOperator('week', param),
|
|
229
|
+
year: param => new AggregationOperator('year', param),
|
|
230
|
+
literal: param => new AggregationOperator('literal', param),
|
|
231
|
+
mergeObjects: param => new AggregationOperator('mergeObjects', param),
|
|
232
|
+
objectToArray: param => new AggregationOperator('objectToArray', param),
|
|
233
|
+
allElementsTrue: param => new AggregationOperator('allElementsTrue', param),
|
|
234
|
+
anyElementTrue: param => new AggregationOperator('anyElementTrue', param),
|
|
235
|
+
setDifference: param => new AggregationOperator('setDifference', param),
|
|
236
|
+
setEquals: param => new AggregationOperator('setEquals', param),
|
|
237
|
+
setIntersection: param => new AggregationOperator('setIntersection', param),
|
|
238
|
+
setIsSubset: param => new AggregationOperator('setIsSubset', param),
|
|
239
|
+
setUnion: param => new AggregationOperator('setUnion', param),
|
|
240
|
+
concat: param => new AggregationOperator('concat', param),
|
|
241
|
+
dateToString: param => new AggregationOperator('dateToString', param),
|
|
242
|
+
indexOfBytes: param => new AggregationOperator('indexOfBytes', param),
|
|
243
|
+
indexOfCP: param => new AggregationOperator('indexOfCP', param),
|
|
244
|
+
split: param => new AggregationOperator('split', param),
|
|
245
|
+
strLenBytes: param => new AggregationOperator('strLenBytes', param),
|
|
246
|
+
strLenCP: param => new AggregationOperator('strLenCP', param),
|
|
247
|
+
strcasecmp: param => new AggregationOperator('strcasecmp', param),
|
|
248
|
+
substr: param => new AggregationOperator('substr', param),
|
|
249
|
+
substrBytes: param => new AggregationOperator('substrBytes', param),
|
|
250
|
+
substrCP: param => new AggregationOperator('substrCP', param),
|
|
251
|
+
toLower: param => new AggregationOperator('toLower', param),
|
|
252
|
+
toUpper: param => new AggregationOperator('toUpper', param),
|
|
253
|
+
meta: param => new AggregationOperator('meta', param),
|
|
254
|
+
addToSet: param => new AggregationOperator('addToSet', param),
|
|
255
|
+
avg: param => new AggregationOperator('avg', param),
|
|
256
|
+
first: param => new AggregationOperator('first', param),
|
|
257
|
+
last: param => new AggregationOperator('last', param),
|
|
258
|
+
max: param => new AggregationOperator('max', param),
|
|
259
|
+
min: param => new AggregationOperator('min', param),
|
|
260
|
+
push: param => new AggregationOperator('push', param),
|
|
261
|
+
stdDevPop: param => new AggregationOperator('stdDevPop', param),
|
|
262
|
+
stdDevSamp: param => new AggregationOperator('stdDevSamp', param),
|
|
263
|
+
sum: param => new AggregationOperator('sum', param),
|
|
264
|
+
let: param => new AggregationOperator('let', param)
|
|
265
|
+
},
|
|
266
|
+
project: {
|
|
267
|
+
slice: param => new ProjectionOperator('slice', param),
|
|
268
|
+
elemMatch: param => new ProjectionOperator('elemMatch', param)
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
export class AggregationOperator {
|
|
272
|
+
constructor(name, param) {
|
|
273
|
+
this['$' + name] = param;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
export class ProjectionOperator {
|
|
277
|
+
constructor(name, param) {
|
|
278
|
+
this['$' + name] = param;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
export default Command;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { InternalSymbol } from '../helper/symbol';
|
|
2
|
-
export declare const AND = "and";
|
|
3
|
-
export declare const OR = "or";
|
|
4
|
-
export declare const NOT = "not";
|
|
5
|
-
export declare const NOR = "nor";
|
|
6
|
-
export declare enum LOGIC_COMMANDS_LITERAL {
|
|
7
|
-
AND = "and",
|
|
8
|
-
OR = "or",
|
|
9
|
-
NOT = "not",
|
|
10
|
-
NOR = "nor"
|
|
11
|
-
}
|
|
12
|
-
export declare class LogicCommand {
|
|
13
|
-
fieldName: string | InternalSymbol;
|
|
14
|
-
operator: LOGIC_COMMANDS_LITERAL | string;
|
|
15
|
-
operands: any[];
|
|
16
|
-
_internalType: InternalSymbol;
|
|
17
|
-
constructor(operator: LOGIC_COMMANDS_LITERAL | string, operands: any, fieldName?: string | InternalSymbol);
|
|
18
|
-
_setFieldName(fieldName: string): LogicCommand;
|
|
19
|
-
and(...__expressions__: LogicCommand[]): LogicCommand;
|
|
20
|
-
or(...__expressions__: LogicCommand[]): LogicCommand;
|
|
21
|
-
}
|
|
22
|
-
export declare function isLogicCommand(object: any): object is LogicCommand;
|
|
23
|
-
export declare function isKnownLogicCommand(object: any): object is LogicCommand;
|
|
24
|
-
export default LogicCommand;
|
|
1
|
+
import { InternalSymbol } from '../helper/symbol';
|
|
2
|
+
export declare const AND = "and";
|
|
3
|
+
export declare const OR = "or";
|
|
4
|
+
export declare const NOT = "not";
|
|
5
|
+
export declare const NOR = "nor";
|
|
6
|
+
export declare enum LOGIC_COMMANDS_LITERAL {
|
|
7
|
+
AND = "and",
|
|
8
|
+
OR = "or",
|
|
9
|
+
NOT = "not",
|
|
10
|
+
NOR = "nor"
|
|
11
|
+
}
|
|
12
|
+
export declare class LogicCommand {
|
|
13
|
+
fieldName: string | InternalSymbol;
|
|
14
|
+
operator: LOGIC_COMMANDS_LITERAL | string;
|
|
15
|
+
operands: any[];
|
|
16
|
+
_internalType: InternalSymbol;
|
|
17
|
+
constructor(operator: LOGIC_COMMANDS_LITERAL | string, operands: any, fieldName?: string | InternalSymbol);
|
|
18
|
+
_setFieldName(fieldName: string): LogicCommand;
|
|
19
|
+
and(...__expressions__: LogicCommand[]): LogicCommand;
|
|
20
|
+
or(...__expressions__: LogicCommand[]): LogicCommand;
|
|
21
|
+
}
|
|
22
|
+
export declare function isLogicCommand(object: any): object is LogicCommand;
|
|
23
|
+
export declare function isKnownLogicCommand(object: any): object is LogicCommand;
|
|
24
|
+
export default LogicCommand;
|