@@ -63,7 +63,15 @@ internal class DisjunctiveTests {
63
63
.collection(" /users" )
64
64
.where(
65
65
field(" name" )
66
- .eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ), constant(" eric" )))
66
+ .eqAny(
67
+ array(
68
+ constant(" alice" ),
69
+ constant(" bob" ),
70
+ constant(" charlie" ),
71
+ constant(" diane" ),
72
+ constant(" eric" )
73
+ )
74
+ )
67
75
)
68
76
69
77
val result = runPipeline(db, pipeline, flowOf(* documents.toTypedArray())).toList()
@@ -85,7 +93,15 @@ internal class DisjunctiveTests {
85
93
.where(
86
94
and (
87
95
field(" name" )
88
- .eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ), constant(" eric" ))),
96
+ .eqAny(
97
+ array(
98
+ constant(" alice" ),
99
+ constant(" bob" ),
100
+ constant(" charlie" ),
101
+ constant(" diane" ),
102
+ constant(" eric" )
103
+ )
104
+ ),
89
105
field(" age" ).eqAny(array(constant(10.0 ), constant(25.0 )))
90
106
)
91
107
)
@@ -108,7 +124,15 @@ internal class DisjunctiveTests {
108
124
.collection(" /users" )
109
125
.where(
110
126
field(" name" )
111
- .eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ), constant(" eric" )))
127
+ .eqAny(
128
+ array(
129
+ constant(" alice" ),
130
+ constant(" bob" ),
131
+ constant(" charlie" ),
132
+ constant(" diane" ),
133
+ constant(" eric" )
134
+ )
135
+ )
112
136
)
113
137
.where(field(" age" ).eqAny(array(constant(10.0 ), constant(25.0 ))))
114
138
@@ -151,7 +175,10 @@ internal class DisjunctiveTests {
151
175
val pipeline =
152
176
RealtimePipelineSource (db)
153
177
.collectionGroup(" users" )
154
- .where(field(" name" ).eqAny(array(constant(" alice" ), constant(" bob" ), constant(" diane" ), constant(" eric" ))))
178
+ .where(
179
+ field(" name" )
180
+ .eqAny(array(constant(" alice" ), constant(" bob" ), constant(" diane" ), constant(" eric" )))
181
+ )
155
182
156
183
val result = runPipeline(db, pipeline, flowOf(* documents.toTypedArray())).toList()
157
184
assertThat(result).containsExactlyElementsIn(listOf (doc1, doc4))
@@ -169,7 +196,10 @@ internal class DisjunctiveTests {
169
196
val pipeline =
170
197
RealtimePipelineSource (db)
171
198
.collection(" /users" )
172
- .where(field(" name" ).eqAny(array(constant(" alice" ), constant(" bob" ), constant(" diane" ), constant(" eric" ))))
199
+ .where(
200
+ field(" name" )
201
+ .eqAny(array(constant(" alice" ), constant(" bob" ), constant(" diane" ), constant(" eric" )))
202
+ )
173
203
.sort(field(" age" ).ascending())
174
204
175
205
val result = runPipeline(db, pipeline, flowOf(* documents.toTypedArray())).toList()
@@ -188,7 +218,10 @@ internal class DisjunctiveTests {
188
218
val pipeline =
189
219
RealtimePipelineSource (db)
190
220
.collection(" /users" )
191
- .where(field(" name" ).eqAny(array(constant(" alice" ), constant(" bob" ), constant(" diane" ), constant(" eric" ))))
221
+ .where(
222
+ field(" name" )
223
+ .eqAny(array(constant(" alice" ), constant(" bob" ), constant(" diane" ), constant(" eric" )))
224
+ )
192
225
.sort(field(" name" ).ascending())
193
226
194
227
val result = runPipeline(db, pipeline, flowOf(* documents.toTypedArray())).toList()
@@ -210,7 +243,15 @@ internal class DisjunctiveTests {
210
243
.where(
211
244
and (
212
245
field(" name" )
213
- .eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ), constant(" eric" ))),
246
+ .eqAny(
247
+ array(
248
+ constant(" alice" ),
249
+ constant(" bob" ),
250
+ constant(" charlie" ),
251
+ constant(" diane" ),
252
+ constant(" eric" )
253
+ )
254
+ ),
214
255
field(" age" ).eq(constant(10.0 ))
215
256
)
216
257
)
@@ -278,7 +319,10 @@ internal class DisjunctiveTests {
278
319
.collection(" /users" )
279
320
.where(
280
321
and (
281
- field(" name" ).eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))),
322
+ field(" name" )
323
+ .eqAny(
324
+ array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))
325
+ ),
282
326
field(" age" ).gt(constant(10.0 )),
283
327
field(" age" ).lt(constant(100.0 ))
284
328
)
@@ -302,7 +346,10 @@ internal class DisjunctiveTests {
302
346
.collection(" /users" )
303
347
.where(
304
348
and (
305
- field(" name" ).eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))),
349
+ field(" name" )
350
+ .eqAny(
351
+ array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))
352
+ ),
306
353
field(" age" ).gte(constant(10.0 )),
307
354
field(" age" ).lte(constant(100.0 ))
308
355
)
@@ -326,7 +373,10 @@ internal class DisjunctiveTests {
326
373
.collection(" /users" )
327
374
.where(
328
375
and (
329
- field(" name" ).eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))),
376
+ field(" name" )
377
+ .eqAny(
378
+ array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))
379
+ ),
330
380
field(" age" ).gt(constant(10.0 )),
331
381
field(" age" ).lt(constant(100.0 ))
332
382
)
@@ -351,7 +401,10 @@ internal class DisjunctiveTests {
351
401
.collection(" /users" )
352
402
.where(
353
403
and (
354
- field(" name" ).eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))),
404
+ field(" name" )
405
+ .eqAny(
406
+ array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))
407
+ ),
355
408
field(" age" ).neq(constant(100.0 ))
356
409
)
357
410
)
@@ -372,7 +425,12 @@ internal class DisjunctiveTests {
372
425
val pipeline =
373
426
RealtimePipelineSource (db)
374
427
.collection(" /users" )
375
- .where(field(" name" ).eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))))
428
+ .where(
429
+ field(" name" )
430
+ .eqAny(
431
+ array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))
432
+ )
433
+ )
376
434
.sort(field(" name" ).ascending())
377
435
378
436
val result = runPipeline(db, pipeline, flowOf(* documents.toTypedArray())).toList()
@@ -412,7 +470,15 @@ internal class DisjunctiveTests {
412
470
.where(
413
471
and (
414
472
field(" name" )
415
- .eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ), constant(" eric" ))),
473
+ .eqAny(
474
+ array(
475
+ constant(" alice" ),
476
+ constant(" bob" ),
477
+ constant(" charlie" ),
478
+ constant(" diane" ),
479
+ constant(" eric" )
480
+ )
481
+ ),
416
482
field(" age" ).eq(constant(10.0 ))
417
483
)
418
484
)
@@ -437,7 +503,15 @@ internal class DisjunctiveTests {
437
503
.where(
438
504
and (
439
505
field(" name" )
440
- .eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ), constant(" eric" ))),
506
+ .eqAny(
507
+ array(
508
+ constant(" alice" ),
509
+ constant(" bob" ),
510
+ constant(" charlie" ),
511
+ constant(" diane" ),
512
+ constant(" eric" )
513
+ )
514
+ ),
441
515
field(" age" ).eq(constant(10.0 ))
442
516
)
443
517
)
@@ -484,7 +558,10 @@ internal class DisjunctiveTests {
484
558
.collection(" /users" )
485
559
.where(
486
560
and (
487
- field(" name" ).eqAny(array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))),
561
+ field(" name" )
562
+ .eqAny(
563
+ array(constant(" alice" ), constant(" bob" ), constant(" charlie" ), constant(" diane" ))
564
+ ),
488
565
field(" age" ).gt(constant(20.0 ))
489
566
)
490
567
)
@@ -584,11 +661,7 @@ internal class DisjunctiveTests {
584
661
doc(
585
662
" users/a" ,
586
663
1000 ,
587
- mapOf (
588
- " name" to " alice" ,
589
- " groups" to listOf (1L , 2L , 3L ),
590
- " records" to listOf (" a" , " b" , " c" )
591
- )
664
+ mapOf (" name" to " alice" , " groups" to listOf (1L , 2L , 3L ), " records" to listOf (" a" , " b" , " c" ))
592
665
)
593
666
val doc2 =
594
667
doc(
@@ -610,11 +683,7 @@ internal class DisjunctiveTests {
610
683
doc(
611
684
" users/d" ,
612
685
1000 ,
613
- mapOf (
614
- " name" to " diane" ,
615
- " groups" to listOf (2L , 3L , 5L ),
616
- " records" to listOf (" c" , " d" , " e" )
617
- )
686
+ mapOf (" name" to " diane" , " groups" to listOf (2L , 3L , 5L ), " records" to listOf (" c" , " d" , " e" ))
618
687
)
619
688
val doc5 =
620
689
doc(
@@ -643,7 +712,11 @@ internal class DisjunctiveTests {
643
712
val doc1 = doc(" users/a" , 1000 , mapOf (" name" to " alice" , " groups" to listOf (1L , 2L , 3L )))
644
713
val doc2 = doc(" users/b" , 1000 , mapOf (" name" to " bob" , " groups" to listOf (1L , 2L , 4L )))
645
714
val doc3 =
646
- doc(" users/c" , 1000 , mapOf (" name" to " charlie" , " groups" to listOf (2L , 3L , 4L ))) // Filtered by LT
715
+ doc(
716
+ " users/c" ,
717
+ 1000 ,
718
+ mapOf (" name" to " charlie" , " groups" to listOf (2L , 3L , 4L ))
719
+ ) // Filtered by LT
647
720
val doc4 = doc(" users/d" , 1000 , mapOf (" name" to " diane" , " groups" to listOf (2L , 3L , 5L )))
648
721
val doc5 = doc(" users/e" , 1000 , mapOf (" name" to " eric" , " groups" to listOf (3L , 4L , 5L )))
649
722
val documents = listOf (doc1, doc2, doc3, doc4, doc5)
@@ -905,7 +978,11 @@ internal class DisjunctiveTests {
905
978
val doc1 = doc(" users/a" , 1000 , mapOf (" name" to " alice" , " age" to 25.0 , " height" to 170.0 ))
906
979
val doc2 = doc(" users/b" , 1000 , mapOf (" name" to " bob" , " age" to 25.0 , " height" to 180.0 ))
907
980
val doc3 =
908
- doc(" users/c" , 1000 , mapOf (" name" to " charlie" , " age" to 100.0 , " height" to 155.0 )) // Not matched
981
+ doc(
982
+ " users/c" ,
983
+ 1000 ,
984
+ mapOf (" name" to " charlie" , " age" to 100.0 , " height" to 155.0 )
985
+ ) // Not matched
909
986
val doc4 = doc(" users/d" , 1000 , mapOf (" name" to " diane" , " age" to 10.0 , " height" to 150.0 ))
910
987
val doc5 = doc(" users/e" , 1000 , mapOf (" name" to " eric" , " age" to 25.0 , " height" to 170.0 ))
911
988
val documents = listOf (doc1, doc2, doc3, doc4, doc5)
@@ -914,11 +991,7 @@ internal class DisjunctiveTests {
914
991
RealtimePipelineSource (db)
915
992
.collection(" /users" )
916
993
.where(or (field(" age" ).lt(constant(80.0 )), field(" height" ).gt(constant(160.0 ))))
917
- .sort(
918
- field(" age" ).ascending(),
919
- field(" height" ).descending(),
920
- field(" name" ).ascending()
921
- )
994
+ .sort(field(" age" ).ascending(), field(" height" ).descending(), field(" name" ).ascending())
922
995
923
996
val result = runPipeline(db, pipeline, flowOf(* documents.toTypedArray())).toList()
924
997
assertThat(result).containsExactly(doc4, doc2, doc1, doc5).inOrder()
@@ -1494,7 +1567,9 @@ internal class DisjunctiveTests {
1494
1567
val pipeline =
1495
1568
RealtimePipelineSource (db)
1496
1569
.collection(" /users" )
1497
- .where(field(" score" ).eqAny(array(constant(50L ), constant(97L ), constant(97L ), constant(97L ))))
1570
+ .where(
1571
+ field(" score" ).eqAny(array(constant(50L ), constant(97L ), constant(97L ), constant(97L )))
1572
+ )
1498
1573
1499
1574
val result = runPipeline(db, pipeline, flowOf(* documents.toTypedArray())).toList()
1500
1575
assertThat(result).containsExactlyElementsIn(listOf (doc2, doc3))
@@ -1526,7 +1601,10 @@ internal class DisjunctiveTests {
1526
1601
val pipeline =
1527
1602
RealtimePipelineSource (db)
1528
1603
.collection(" /users" )
1529
- .where(field(" scores" ).arrayContainsAny(array(constant(1L ), constant(2L ), constant(2L ), constant(2L ))))
1604
+ .where(
1605
+ field(" scores" )
1606
+ .arrayContainsAny(array(constant(1L ), constant(2L ), constant(2L ), constant(2L )))
1607
+ )
1530
1608
1531
1609
val result = runPipeline(db, pipeline, flowOf(* documents.toTypedArray())).toList()
1532
1610
assertThat(result).containsExactly(doc1)
@@ -1543,7 +1621,9 @@ internal class DisjunctiveTests {
1543
1621
.collection(" /users" )
1544
1622
.where(
1545
1623
field(" scores" )
1546
- .arrayContainsAll(array(constant(1L ), constant(2L ), constant(2L ), constant(2L ), constant(3L )))
1624
+ .arrayContainsAll(
1625
+ array(constant(1L ), constant(2L ), constant(2L ), constant(2L ), constant(3L ))
1626
+ )
1547
1627
)
1548
1628
val result = runPipeline(db, pipeline, flowOf(* documents.toTypedArray())).toList()
1549
1629
// The C++ test `EXPECT_THAT(RunPipeline(pipeline, documents), ElementsAre(doc1, doc2));`
0 commit comments