forked from aerospike/aerospike-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
expression.go
831 lines (755 loc) · 19.7 KB
/
expression.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
// Copyright 2014-2021 Aerospike, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.package aerospike
package aerospike
import (
"encoding/base64"
ParticleType "github.com/aerospike/aerospike-client-go/internal/particle_type"
)
// ExpressionArgument is used for passing arguments to filter expressions.
// The accptable arguments are:
// Value, ExpressionFilter, []*CDTContext
type ExpressionArgument interface {
pack(BufferEx) (int, error)
}
// ExpType defines the expression's data type.
type ExpType uint
var (
// ExpTypeNIL is NIL Expression Type
ExpTypeNIL ExpType = 0
// ExpTypeBOOL is BOOLEAN Expression Type
ExpTypeBOOL ExpType = 1
// ExpTypeINT is INTEGER Expression Type
ExpTypeINT ExpType = 2
// ExpTypeSTRING is STRING Expression Type
ExpTypeSTRING ExpType = 3
// ExpTypeLIST is LIST Expression Type
ExpTypeLIST ExpType = 4
// ExpTypeMAP is MAP Expression Type
ExpTypeMAP ExpType = 5
// ExpTypeBLOB is BLOB Expression Type
ExpTypeBLOB ExpType = 6
// ExpTypeFLOAT is FLOAT Expression Type
ExpTypeFLOAT ExpType = 7
// ExpTypeGEO is GEO String Expression Type
ExpTypeGEO ExpType = 8
// ExpTypeHLL is HLL Expression Type
ExpTypeHLL ExpType = 9
)
type expOp uint
var (
expOpEQ expOp = 1
expOpNE expOp = 2
expOpGT expOp = 3
expOpGE expOp = 4
expOpLT expOp = 5
expOpLE expOp = 6
expOpREGEX expOp = 7
expOpGEO expOp = 8
expOpAND expOp = 16
expOpOR expOp = 17
expOpNOT expOp = 18
expOpDIGEST_MODULO expOp = 64
expOpDEVICE_SIZE expOp = 65
expOpLAST_UPDATE expOp = 66
expOpSINCE_UPDATE expOp = 67
expOpVOID_TIME expOp = 68
expOpTTL expOp = 69
expOpSET_NAME expOp = 70
expOpKEY_EXISTS expOp = 71
expOpIS_TOMBSTONE expOp = 72
expOpMEMORY_SIZE expOp = 73
expOpKEY expOp = 80
expOpBIN expOp = 81
expOpBIN_TYPE expOp = 82
expOpQUOTED expOp = 126
expOpCALL expOp = 127
)
const _MODIFY = 0x40
// ExpRegexFlags is used to change the Regex Mode in Expression Filters.
type ExpRegexFlags int
const (
// ExpRegexFlagNONE uses regex defaults.
ExpRegexFlagNONE ExpRegexFlags = 0
// ExpRegexFlagEXTENDED uses POSIX Extended Regular Expression syntax when interpreting regex.
ExpRegexFlagEXTENDED ExpRegexFlags = 1
// ExpRegexFlagICASE does not differentiate cases.
ExpRegexFlagICASE ExpRegexFlags = 2
// ExpRegexFlagNOSUB does not report position of matches.
ExpRegexFlagNOSUB ExpRegexFlags = 3
// ExpRegexFlagNEWLINE does not Match-any-character operators don't match a newline.
ExpRegexFlagNEWLINE ExpRegexFlags = 8
)
// FilterExpression which can be applied to most commands, to control which records are
// affected by the command. Filter expression are created using the functions in the
// [expressions](crate::expressions) module and its submodules.
type FilterExpression struct {
// The Operation code
cmd *expOp
// The Primary Value of the Operation
val Value
// The Bin to use it on (REGEX for example)
bin *FilterExpression
// The additional flags for the Operation (REGEX or return_type of Module for example)
flags *int64
// The optional Module flag for Module operations or Bin Types
module *ExpType
// Sub commands for the CmdExp operation
exps []*FilterExpression
arguments []ExpressionArgument
}
func newFilterExpression(
cmd *expOp,
val Value,
bin *FilterExpression,
flags *int64,
module *ExpType,
exps []*FilterExpression,
) *FilterExpression {
return &FilterExpression{
cmd: cmd,
val: val,
bin: bin,
flags: flags,
module: module,
exps: exps,
arguments: nil,
}
}
func (fe *FilterExpression) packExpression(
exps []*FilterExpression,
buf BufferEx,
) (int, error) {
size := 0
sz, err := packArrayBegin(buf, len(exps)+1)
size += sz
if err != nil {
return size, err
}
sz, err = packAInt64(buf, int64(*fe.cmd))
size += sz
if err != nil {
return size, err
}
for _, exp := range exps {
sz, err = exp.pack(buf)
size += sz
if err != nil {
return size, err
}
}
return size, nil
}
func (fe *FilterExpression) packCommand(cmd *expOp, buf BufferEx) (int, error) {
size := 0
switch cmd {
case &expOpREGEX:
sz, err := packArrayBegin(buf, 4)
if err != nil {
return size, err
}
size += sz
// The Operation
sz, err = packAInt64(buf, int64(*cmd))
if err != nil {
return size, err
}
size += sz
// Regex Flags
sz, err = packAInt64(buf, *fe.flags)
if err != nil {
return size, err
}
size += sz
// Raw String is needed instead of the msgpack String that the pack_value method would use.
sz, err = packRawString(buf, fe.val.String())
if err != nil {
return size, err
}
size += sz
// The Bin
sz, err = fe.bin.pack(buf)
if err != nil {
return size, err
}
size += sz
case &expOpCALL:
// Packing logic for Module
sz, err := packArrayBegin(buf, 5)
if err != nil {
return size, err
}
size += sz
// The Operation
sz, err = packAInt64(buf, int64(*cmd))
if err != nil {
return size, err
}
size += sz
// The Module Operation
sz, err = packAInt64(buf, int64(*fe.module))
if err != nil {
return size, err
}
size += sz
// The Module (List/Map or Bitwise)
sz, err = packAInt64(buf, *fe.flags)
if err != nil {
return size, err
}
size += sz
// Encoding the Arguments
if args := fe.arguments; len(args) > 0 {
argLen := 0
for _, arg := range args {
// First match to estimate the Size and write the Context
switch v := arg.(type) {
case Value, *FilterExpression:
argLen++
case cdtContextList:
if len(v) > 0 {
sz, err = packArrayBegin(buf, 3)
if err != nil {
return size, err
}
size += sz
sz, err = packAInt64(buf, 0xff)
if err != nil {
return size, err
}
size += sz
sz, err = packArrayBegin(buf, len(v)*2)
if err != nil {
return size, err
}
size += sz
for _, c := range v {
sz, err = c.pack(buf)
if err != nil {
return size, err
}
size += sz
}
}
default:
panic("Value `%v` is not acceptable in Expression Filters as an argument")
}
}
sz, err = packArrayBegin(buf, argLen)
if err != nil {
return size, err
}
size += sz
// Second match to write the real values
for _, arg := range args {
switch val := arg.(type) {
case Value:
sz, err = val.pack(buf)
if err != nil {
return size, err
}
size += sz
case *FilterExpression:
sz, err = val.pack(buf)
if err != nil {
return size, err
}
size += sz
default:
}
}
} else {
// No Arguments
sz, err = fe.val.pack(buf)
if err != nil {
return size, err
}
size += sz
}
// Write the Bin
sz, err = fe.bin.pack(buf)
if err != nil {
return size, err
}
size += sz
case &expOpBIN:
// Bin Encoder
sz, err := packArrayBegin(buf, 3)
if err != nil {
return size, err
}
size += sz
// The Bin Operation
sz, err = packAInt64(buf, int64(*cmd))
if err != nil {
return size, err
}
size += sz
// The Bin Type (INT/String etc.)
sz, err = packAInt64(buf, int64(*fe.module))
if err != nil {
return size, err
}
size += sz
// The name - Raw String is needed instead of the msgpack String that the pack_value method would use.
sz, err = packRawString(buf, fe.val.String())
if err != nil {
return size, err
}
size += sz
case &expOpBIN_TYPE:
// BinType encoder
sz, err := packArrayBegin(buf, 2)
if err != nil {
return size, err
}
size += sz
// BinType Operation
sz, err = packAInt64(buf, int64(*cmd))
if err != nil {
return size, err
}
size += sz
// The name - Raw String is needed instead of the msgpack String that the pack_value method would use.
sz, err = packRawString(buf, fe.val.String())
if err != nil {
return size, err
}
size += sz
default:
// Packing logic for all other Ops
if value := fe.val; value != nil {
// Operation has a Value
sz, err := packArrayBegin(buf, 2)
if err != nil {
return size, err
}
size += sz
// Write the Operation
sz, err = packAInt64(buf, int64(*cmd))
if err != nil {
return size, err
}
size += sz
// Write the Value
sz, err = value.pack(buf)
if err != nil {
return size, err
}
size += sz
} else {
// Operation has no Value
sz, err := packArrayBegin(buf, 1)
if err != nil {
return size, err
}
size += sz
// Write the Operation
sz, err = packAInt64(buf, int64(*cmd))
if err != nil {
return size, err
}
size += sz
}
}
return size, nil
}
func (fe *FilterExpression) packValue(buf BufferEx) (int, error) {
// Packing logic for Value based Ops
return fe.val.pack(buf)
}
func (fe *FilterExpression) pack(buf BufferEx) (int, error) {
if len(fe.exps) > 0 {
return fe.packExpression(fe.exps, buf)
} else if fe.cmd != nil {
return fe.packCommand(fe.cmd, buf)
}
return fe.packValue(buf)
}
func (fe *FilterExpression) base64() (string, error) {
sz, err := fe.pack(nil)
if err != nil {
return "", err
}
input := newBuffer(sz)
_, err = fe.pack(input)
if err != nil {
return "", err
}
return base64.StdEncoding.EncodeToString(input.dataBuffer[:input.dataOffset]), nil
}
// ExpKey creates a record key expression of specified type.
func ExpKey(expType ExpType) *FilterExpression {
return newFilterExpression(
&expOpKEY,
IntegerValue(int64(expType)),
nil,
nil,
nil,
nil,
)
}
// ExpKeyExists creates a function that returns if the primary key is stored in the record meta data
// as a boolean expression. This would occur when `send_key` is true on record write.
func ExpKeyExists() *FilterExpression {
return newFilterExpression(&expOpKEY_EXISTS, nil, nil, nil, nil, nil)
}
// ExpIntBin creates a 64 bit int bin expression.
func ExpIntBin(name string) *FilterExpression {
return newFilterExpression(
&expOpBIN,
StringValue(name),
nil,
nil,
&ExpTypeINT,
nil,
)
}
// ExpStringBin creates a string bin expression.
func ExpStringBin(name string) *FilterExpression {
return newFilterExpression(
&expOpBIN,
StringValue(name),
nil,
nil,
&ExpTypeSTRING,
nil,
)
}
// ExpBlobBin creates a blob bin expression.
func ExpBlobBin(name string) *FilterExpression {
return newFilterExpression(
&expOpBIN,
StringValue(name),
nil,
nil,
&ExpTypeBLOB,
nil,
)
}
// ExpFloatBin creates a 64 bit float bin expression.
func ExpFloatBin(name string) *FilterExpression {
return newFilterExpression(
&expOpBIN,
StringValue(name),
nil,
nil,
&ExpTypeFLOAT,
nil,
)
}
// ExpGeoBin creates a geo bin expression.
func ExpGeoBin(name string) *FilterExpression {
return newFilterExpression(
&expOpBIN,
StringValue(name),
nil,
nil,
&ExpTypeGEO,
nil,
)
}
// ExpListBin creates a list bin expression.
func ExpListBin(name string) *FilterExpression {
return newFilterExpression(
&expOpBIN,
StringValue(name),
nil,
nil,
&ExpTypeLIST,
nil,
)
}
// ExpMapBin creates a map bin expression.
func ExpMapBin(name string) *FilterExpression {
return newFilterExpression(
&expOpBIN,
StringValue(name),
nil,
nil,
&ExpTypeMAP,
nil,
)
}
// ExpHLLBin creates a a HLL bin expression
func ExpHLLBin(name string) *FilterExpression {
return newFilterExpression(
&expOpBIN,
StringValue(name),
nil,
nil,
&ExpTypeHLL,
nil,
)
}
// ExpBinExists creates a function that returns if bin of specified name exists.
func ExpBinExists(name string) *FilterExpression {
return ExpNotEq(ExpBinType(name), ExpIntVal(ParticleType.NULL))
}
// ExpBinType creates a function that returns bin's integer particle type.
func ExpBinType(name string) *FilterExpression {
return newFilterExpression(
&expOpBIN_TYPE,
StringValue(name),
nil,
nil,
nil,
nil,
)
}
// ExpSetName creates a function that returns record set name string.
func ExpSetName() *FilterExpression {
return newFilterExpression(&expOpSET_NAME, nil, nil, nil, nil, nil)
}
// ExpDeviceSize creates a function that returns record size on disk.
// If server storage-engine is memory, then zero is returned.
func ExpDeviceSize() *FilterExpression {
return newFilterExpression(&expOpDEVICE_SIZE, nil, nil, nil, nil, nil)
}
// ExpMemorySize creates expression that returns record size in memory. If server storage-engine is
// not memory nor data-in-memory, then zero is returned. This expression usually evaluates
// quickly because record meta data is cached in memory.
func ExpMemorySize() *FilterExpression {
return newFilterExpression(&expOpMEMORY_SIZE, nil, nil, nil, nil, nil)
}
// ExpLastUpdate creates a function that returns record last update time expressed as 64 bit integer
// nanoseconds since 1970-01-01 epoch.
func ExpLastUpdate() *FilterExpression {
return newFilterExpression(&expOpLAST_UPDATE, nil, nil, nil, nil, nil)
}
// ExpSinceUpdate creates a expression that returns milliseconds since the record was last updated.
// This expression usually evaluates quickly because record meta data is cached in memory.
func ExpSinceUpdate() *FilterExpression {
return newFilterExpression(&expOpSINCE_UPDATE, nil, nil, nil, nil, nil)
}
// ExpVoidTime creates a function that returns record expiration time expressed as 64 bit integer
// nanoseconds since 1970-01-01 epoch.
func ExpVoidTime() *FilterExpression {
return newFilterExpression(&expOpVOID_TIME, nil, nil, nil, nil, nil)
}
// ExpTTL creates a function that returns record expiration time (time to live) in integer seconds.
func ExpTTL() *FilterExpression {
return newFilterExpression(&expOpTTL, nil, nil, nil, nil, nil)
}
// ExpIsTombstone creates a expression that returns if record has been deleted and is still in tombstone state.
// This expression usually evaluates quickly because record meta data is cached in memory.
func ExpIsTombstone() *FilterExpression {
return newFilterExpression(&expOpIS_TOMBSTONE, nil, nil, nil, nil, nil)
}
// ExpDigestModulo creates a function that returns record digest modulo as integer.
func ExpDigestModulo(modulo int64) *FilterExpression {
return newFilterExpression(
&expOpDIGEST_MODULO,
NewValue(modulo),
nil,
nil,
nil,
nil,
)
}
// ExpRegexCompare creates a function like regular expression string operation.
func ExpRegexCompare(regex string, flags ExpRegexFlags, bin *FilterExpression) *FilterExpression {
iflags := int64(flags)
return newFilterExpression(
&expOpREGEX,
StringValue(regex),
bin,
&iflags,
nil,
nil,
)
}
// ExpGeoCompare creates a compare geospatial operation.
func ExpGeoCompare(left *FilterExpression, right *FilterExpression) *FilterExpression {
return newFilterExpression(
&expOpGEO,
nil,
nil,
nil,
nil,
[]*FilterExpression{left, right},
)
}
// ExpIntVal creates a 64 bit integer value
func ExpIntVal(val int64) *FilterExpression {
return newFilterExpression(nil, IntegerValue(val), nil, nil, nil, nil)
}
// ExpBoolVal creates a Boolean value
func ExpBoolVal(val bool) *FilterExpression {
return newFilterExpression(nil, _BoolValue(val), nil, nil, nil, nil)
}
// ExpStringVal creates a String bin value
func ExpStringVal(val string) *FilterExpression {
return newFilterExpression(nil, StringValue(val), nil, nil, nil, nil)
}
// ExpFloatVal creates a 64 bit float bin value
func ExpFloatVal(val float64) *FilterExpression {
return newFilterExpression(nil, FloatValue(val), nil, nil, nil, nil)
}
// ExpBlobVal creates a Blob bin value
func ExpBlobVal(val []byte) *FilterExpression {
return newFilterExpression(nil, BytesValue(val), nil, nil, nil, nil)
}
// ExpListVal creates a List bin Value
func ExpListVal(val ...Value) *FilterExpression {
return newFilterExpression(
&expOpQUOTED,
ValueArray(val),
nil,
nil,
nil,
nil,
)
}
// ExpValueArrayVal creates a List bin Value
func ExpValueArrayVal(val ValueArray) *FilterExpression {
return newFilterExpression(
&expOpQUOTED,
val,
nil,
nil,
nil,
nil,
)
}
// ExpListValueVal creates a List bin Value
func ExpListValueVal(val ...interface{}) *FilterExpression {
return newFilterExpression(
&expOpQUOTED,
NewListValue(val),
nil,
nil,
nil,
nil,
)
}
// ExpMapVal creates a Map bin Value
func ExpMapVal(val MapValue) *FilterExpression {
return newFilterExpression(nil, val, nil, nil, nil, nil)
}
// ExpGeoVal creates a geospatial json string value.
func ExpGeoVal(val string) *FilterExpression {
return newFilterExpression(nil, GeoJSONValue(val), nil, nil, nil, nil)
}
// ExpNilValue creates a a Nil Value
func ExpNilValue() *FilterExpression {
return newFilterExpression(nil, nullValue, nil, nil, nil, nil)
}
// ExpNot creates a "not" operator expression.
func ExpNot(exp *FilterExpression) *FilterExpression {
return &FilterExpression{
cmd: &expOpNOT,
val: nil,
bin: nil,
flags: nil,
module: nil,
exps: []*FilterExpression{exp},
arguments: nil,
}
}
// ExpAnd creates a "and" (&&) operator that applies to a variable number of expressions.
func ExpAnd(exps ...*FilterExpression) *FilterExpression {
return &FilterExpression{
cmd: &expOpAND,
val: nil,
bin: nil,
flags: nil,
module: nil,
exps: exps,
arguments: nil,
}
}
// ExpOr creates a "or" (||) operator that applies to a variable number of expressions.
func ExpOr(exps ...*FilterExpression) *FilterExpression {
return &FilterExpression{
cmd: &expOpOR,
val: nil,
bin: nil,
flags: nil,
module: nil,
exps: exps,
arguments: nil,
}
}
// ExpEq creates a equal (==) expression.
func ExpEq(left *FilterExpression, right *FilterExpression) *FilterExpression {
return &FilterExpression{
cmd: &expOpEQ,
val: nil,
bin: nil,
flags: nil,
module: nil,
exps: []*FilterExpression{left, right},
arguments: nil,
}
}
// ExpNotEq creates a not equal (!=) expression
func ExpNotEq(left *FilterExpression, right *FilterExpression) *FilterExpression {
return &FilterExpression{
cmd: &expOpNE,
val: nil,
bin: nil,
flags: nil,
module: nil,
exps: []*FilterExpression{left, right},
arguments: nil,
}
}
// ExpGreater creates a greater than (>) operation.
func ExpGreater(left *FilterExpression, right *FilterExpression) *FilterExpression {
return &FilterExpression{
cmd: &expOpGT,
val: nil,
bin: nil,
flags: nil,
module: nil,
exps: []*FilterExpression{left, right},
arguments: nil,
}
}
// ExpGreaterEq creates a greater than or equal (>=) operation.
func ExpGreaterEq(left *FilterExpression, right *FilterExpression) *FilterExpression {
return &FilterExpression{
cmd: &expOpGE,
val: nil,
bin: nil,
flags: nil,
module: nil,
exps: []*FilterExpression{left, right},
arguments: nil,
}
}
// ExpLess creates a less than (<) operation.
func ExpLess(left *FilterExpression, right *FilterExpression) *FilterExpression {
return &FilterExpression{
cmd: &expOpLT,
val: nil,
bin: nil,
flags: nil,
module: nil,
exps: []*FilterExpression{left, right},
arguments: nil,
}
}
// ExpLessEq creates a less than or equals (<=) operation.
func ExpLessEq(left *FilterExpression, right *FilterExpression) *FilterExpression {
return &FilterExpression{
cmd: &expOpLE,
val: nil,
bin: nil,
flags: nil,
module: nil,
exps: []*FilterExpression{left, right},
arguments: nil,
}
}