@@ -2818,9 +2818,6 @@ apiDescribe('Database', persistence => {
2818
2818
settings ,
2819
2819
testDocs ,
2820
2820
async coll => {
2821
- // Populate the cache with all docs first
2822
- await getDocs ( coll ) ;
2823
-
2824
2821
let orderedQuery = query (
2825
2822
coll ,
2826
2823
where ( 'key' , '>' , new BsonObjectId ( '507f191e810c19729de860ea' ) ) ,
@@ -2833,6 +2830,7 @@ apiDescribe('Database', persistence => {
2833
2830
testDocs [ 'b' ]
2834
2831
] ) ;
2835
2832
await assertSDKQueryResultsConsistentWithBackend (
2833
+ coll ,
2836
2834
orderedQuery ,
2837
2835
testDocs ,
2838
2836
toIds ( snapshot )
@@ -2853,6 +2851,7 @@ apiDescribe('Database', persistence => {
2853
2851
testDocs [ 'a' ]
2854
2852
] ) ;
2855
2853
await assertSDKQueryResultsConsistentWithBackend (
2854
+ coll ,
2856
2855
orderedQuery ,
2857
2856
testDocs ,
2858
2857
toIds ( snapshot )
@@ -2873,9 +2872,6 @@ apiDescribe('Database', persistence => {
2873
2872
settings ,
2874
2873
testDocs ,
2875
2874
async coll => {
2876
- // Populate the cache with all docs first
2877
- await getDocs ( coll ) ;
2878
-
2879
2875
let orderedQuery = query (
2880
2876
coll ,
2881
2877
where ( 'key' , '>=' , new Int32Value ( 1 ) ) ,
@@ -2888,6 +2884,7 @@ apiDescribe('Database', persistence => {
2888
2884
testDocs [ 'b' ]
2889
2885
] ) ;
2890
2886
await assertSDKQueryResultsConsistentWithBackend (
2887
+ coll ,
2891
2888
orderedQuery ,
2892
2889
testDocs ,
2893
2890
toIds ( snapshot )
@@ -2905,6 +2902,7 @@ apiDescribe('Database', persistence => {
2905
2902
testDocs [ 'a' ]
2906
2903
] ) ;
2907
2904
await assertSDKQueryResultsConsistentWithBackend (
2905
+ coll ,
2908
2906
orderedQuery ,
2909
2907
testDocs ,
2910
2908
toIds ( snapshot )
@@ -2925,9 +2923,6 @@ apiDescribe('Database', persistence => {
2925
2923
settings ,
2926
2924
testDocs ,
2927
2925
async coll => {
2928
- // Populate the cache with all docs first
2929
- await getDocs ( coll ) ;
2930
-
2931
2926
let orderedQuery = query (
2932
2927
coll ,
2933
2928
where ( 'key' , '>' , new BsonTimestamp ( 1 , 1 ) ) ,
@@ -2940,6 +2935,7 @@ apiDescribe('Database', persistence => {
2940
2935
testDocs [ 'b' ]
2941
2936
] ) ;
2942
2937
await assertSDKQueryResultsConsistentWithBackend (
2938
+ coll ,
2943
2939
orderedQuery ,
2944
2940
testDocs ,
2945
2941
toIds ( snapshot )
@@ -2957,6 +2953,7 @@ apiDescribe('Database', persistence => {
2957
2953
testDocs [ 'b' ]
2958
2954
] ) ;
2959
2955
await assertSDKQueryResultsConsistentWithBackend (
2956
+ coll ,
2960
2957
orderedQuery ,
2961
2958
testDocs ,
2962
2959
toIds ( snapshot )
@@ -2977,9 +2974,6 @@ apiDescribe('Database', persistence => {
2977
2974
settings ,
2978
2975
testDocs ,
2979
2976
async coll => {
2980
- // Populate the cache with all docs first
2981
- await getDocs ( coll ) ;
2982
-
2983
2977
let orderedQuery = query (
2984
2978
coll ,
2985
2979
where ( 'key' , '>' , new BsonBinaryData ( 1 , new Uint8Array ( [ 1 , 2 , 3 ] ) ) ) ,
@@ -2992,6 +2986,7 @@ apiDescribe('Database', persistence => {
2992
2986
testDocs [ 'b' ]
2993
2987
] ) ;
2994
2988
await assertSDKQueryResultsConsistentWithBackend (
2989
+ coll ,
2995
2990
orderedQuery ,
2996
2991
testDocs ,
2997
2992
toIds ( snapshot )
@@ -3014,6 +3009,7 @@ apiDescribe('Database', persistence => {
3014
3009
testDocs [ 'a' ]
3015
3010
] ) ;
3016
3011
await assertSDKQueryResultsConsistentWithBackend (
3012
+ coll ,
3017
3013
orderedQuery ,
3018
3014
testDocs ,
3019
3015
toIds ( snapshot )
@@ -3034,9 +3030,6 @@ apiDescribe('Database', persistence => {
3034
3030
settings ,
3035
3031
testDocs ,
3036
3032
async coll => {
3037
- // Populate the cache with all docs first
3038
- await getDocs ( coll ) ;
3039
-
3040
3033
const orderedQuery = query (
3041
3034
coll ,
3042
3035
or (
@@ -3052,6 +3045,7 @@ apiDescribe('Database', persistence => {
3052
3045
testDocs [ 'a' ]
3053
3046
] ) ;
3054
3047
await assertSDKQueryResultsConsistentWithBackend (
3048
+ coll ,
3055
3049
orderedQuery ,
3056
3050
testDocs ,
3057
3051
toIds ( snapshot )
@@ -3074,9 +3068,6 @@ apiDescribe('Database', persistence => {
3074
3068
settings ,
3075
3069
testDocs ,
3076
3070
async coll => {
3077
- // Populate the cache with all docs first
3078
- await getDocs ( coll ) ;
3079
-
3080
3071
let filteredQuery = query (
3081
3072
coll ,
3082
3073
where ( 'key' , '==' , MinKey . instance ( ) )
@@ -3087,23 +3078,24 @@ apiDescribe('Database', persistence => {
3087
3078
testDocs [ 'b' ]
3088
3079
] ) ;
3089
3080
await assertSDKQueryResultsConsistentWithBackend (
3081
+ coll ,
3090
3082
filteredQuery ,
3091
3083
testDocs ,
3092
3084
toIds ( snapshot )
3093
3085
) ;
3094
3086
3095
- // TODO(Mila/BSON): uncomment after the null inclusion bug
3096
- // filteredQuery = query(coll, where('key', '!=', MinKey.instance()) );
3097
- // snapshot = await getDocs(filteredQuery);
3098
- // expect(toDataArray(snapshot)).to.deep.equal([
3099
- // testDocs['d'],
3100
- // testDocs['e']
3101
- // ]);
3102
- // await assertSDKQueryResultsConsistentWithBackend(
3103
- // filteredQuery,
3104
- // testDocs,
3105
- // toIds(snapshot)
3106
- // );
3087
+ filteredQuery = query ( coll , where ( 'key' , '!=' , MinKey . instance ( ) ) ) ;
3088
+ snapshot = await getDocs ( filteredQuery ) ;
3089
+ expect ( toDataArray ( snapshot ) ) . to . deep . equal ( [
3090
+ testDocs [ 'd' ] ,
3091
+ testDocs [ 'e' ]
3092
+ ] ) ;
3093
+ await assertSDKQueryResultsConsistentWithBackend (
3094
+ coll ,
3095
+ filteredQuery ,
3096
+ testDocs ,
3097
+ toIds ( snapshot )
3098
+ ) ;
3107
3099
3108
3100
filteredQuery = query ( coll , where ( 'key' , '>=' , MinKey . instance ( ) ) ) ;
3109
3101
snapshot = await getDocs ( filteredQuery ) ;
@@ -3112,6 +3104,7 @@ apiDescribe('Database', persistence => {
3112
3104
testDocs [ 'b' ]
3113
3105
] ) ;
3114
3106
await assertSDKQueryResultsConsistentWithBackend (
3107
+ coll ,
3115
3108
filteredQuery ,
3116
3109
testDocs ,
3117
3110
toIds ( snapshot )
@@ -3124,6 +3117,7 @@ apiDescribe('Database', persistence => {
3124
3117
testDocs [ 'b' ]
3125
3118
] ) ;
3126
3119
await assertSDKQueryResultsConsistentWithBackend (
3120
+ coll ,
3127
3121
filteredQuery ,
3128
3122
testDocs ,
3129
3123
toIds ( snapshot )
@@ -3133,6 +3127,7 @@ apiDescribe('Database', persistence => {
3133
3127
snapshot = await getDocs ( filteredQuery ) ;
3134
3128
expect ( toDataArray ( snapshot ) ) . to . deep . equal ( [ ] ) ;
3135
3129
await assertSDKQueryResultsConsistentWithBackend (
3130
+ coll ,
3136
3131
filteredQuery ,
3137
3132
testDocs ,
3138
3133
toIds ( snapshot )
@@ -3142,6 +3137,7 @@ apiDescribe('Database', persistence => {
3142
3137
snapshot = await getDocs ( filteredQuery ) ;
3143
3138
expect ( toDataArray ( snapshot ) ) . to . deep . equal ( [ ] ) ;
3144
3139
await assertSDKQueryResultsConsistentWithBackend (
3140
+ coll ,
3145
3141
filteredQuery ,
3146
3142
testDocs ,
3147
3143
toIds ( snapshot )
@@ -3151,6 +3147,7 @@ apiDescribe('Database', persistence => {
3151
3147
snapshot = await getDocs ( filteredQuery ) ;
3152
3148
expect ( toDataArray ( snapshot ) ) . to . deep . equal ( [ ] ) ;
3153
3149
await assertSDKQueryResultsConsistentWithBackend (
3150
+ coll ,
3154
3151
filteredQuery ,
3155
3152
testDocs ,
3156
3153
toIds ( snapshot )
@@ -3173,9 +3170,6 @@ apiDescribe('Database', persistence => {
3173
3170
settings ,
3174
3171
testDocs ,
3175
3172
async coll => {
3176
- // Populate the cache with all docs first
3177
- await getDocs ( coll ) ;
3178
-
3179
3173
let filteredQuery = query (
3180
3174
coll ,
3181
3175
where ( 'key' , '==' , MaxKey . instance ( ) )
@@ -3186,23 +3180,24 @@ apiDescribe('Database', persistence => {
3186
3180
testDocs [ 'd' ]
3187
3181
] ) ;
3188
3182
await assertSDKQueryResultsConsistentWithBackend (
3183
+ coll ,
3189
3184
filteredQuery ,
3190
3185
testDocs ,
3191
3186
toIds ( snapshot )
3192
3187
) ;
3193
3188
3194
- // TODO(Mila/BSON): uncomment after the null inclusion bug
3195
- // filteredQuery = query(coll, where('key', '!=', MaxKey.instance()) );
3196
- // snapshot = await getDocs(filteredQuery);
3197
- // expect(toDataArray(snapshot)).to.deep.equal([
3198
- // testDocs['a'],
3199
- // testDocs['b']
3200
- // ]);
3201
- // await assertSDKQueryResultsConsistentWithBackend(
3202
- // filteredQuery,
3203
- // testDocs,
3204
- // toIds(snapshot)
3205
- // );
3189
+ filteredQuery = query ( coll , where ( 'key' , '!=' , MaxKey . instance ( ) ) ) ;
3190
+ snapshot = await getDocs ( filteredQuery ) ;
3191
+ expect ( toDataArray ( snapshot ) ) . to . deep . equal ( [
3192
+ testDocs [ 'a' ] ,
3193
+ testDocs [ 'b' ]
3194
+ ] ) ;
3195
+ await assertSDKQueryResultsConsistentWithBackend (
3196
+ coll ,
3197
+ filteredQuery ,
3198
+ testDocs ,
3199
+ toIds ( snapshot )
3200
+ ) ;
3206
3201
3207
3202
filteredQuery = query ( coll , where ( 'key' , '>=' , MaxKey . instance ( ) ) ) ;
3208
3203
snapshot = await getDocs ( filteredQuery ) ;
@@ -3211,6 +3206,7 @@ apiDescribe('Database', persistence => {
3211
3206
testDocs [ 'd' ]
3212
3207
] ) ;
3213
3208
await assertSDKQueryResultsConsistentWithBackend (
3209
+ coll ,
3214
3210
filteredQuery ,
3215
3211
testDocs ,
3216
3212
toIds ( snapshot )
@@ -3223,6 +3219,7 @@ apiDescribe('Database', persistence => {
3223
3219
testDocs [ 'd' ]
3224
3220
] ) ;
3225
3221
await assertSDKQueryResultsConsistentWithBackend (
3222
+ coll ,
3226
3223
filteredQuery ,
3227
3224
testDocs ,
3228
3225
toIds ( snapshot )
@@ -3232,6 +3229,7 @@ apiDescribe('Database', persistence => {
3232
3229
snapshot = await getDocs ( filteredQuery ) ;
3233
3230
expect ( toDataArray ( snapshot ) ) . to . deep . equal ( [ ] ) ;
3234
3231
await assertSDKQueryResultsConsistentWithBackend (
3232
+ coll ,
3235
3233
filteredQuery ,
3236
3234
testDocs ,
3237
3235
toIds ( snapshot )
@@ -3241,6 +3239,7 @@ apiDescribe('Database', persistence => {
3241
3239
snapshot = await getDocs ( filteredQuery ) ;
3242
3240
expect ( toDataArray ( snapshot ) ) . to . deep . equal ( [ ] ) ;
3243
3241
await assertSDKQueryResultsConsistentWithBackend (
3242
+ coll ,
3244
3243
filteredQuery ,
3245
3244
testDocs ,
3246
3245
toIds ( snapshot )
@@ -3250,6 +3249,7 @@ apiDescribe('Database', persistence => {
3250
3249
snapshot = await getDocs ( filteredQuery ) ;
3251
3250
expect ( toDataArray ( snapshot ) ) . to . deep . equal ( [ ] ) ;
3252
3251
await assertSDKQueryResultsConsistentWithBackend (
3252
+ coll ,
3253
3253
filteredQuery ,
3254
3254
testDocs ,
3255
3255
toIds ( snapshot )
@@ -3273,16 +3273,14 @@ apiDescribe('Database', persistence => {
3273
3273
settings ,
3274
3274
testDocs ,
3275
3275
async coll => {
3276
- // Populate the cache with all docs first
3277
- await getDocs ( coll ) ;
3278
-
3279
3276
let filteredQuery = query ( coll , where ( 'key' , '==' , null ) ) ;
3280
3277
let snapshot = await getDocs ( filteredQuery ) ;
3281
3278
expect ( toDataArray ( snapshot ) ) . to . deep . equal ( [
3282
3279
testDocs [ 'b' ] ,
3283
3280
testDocs [ 'c' ]
3284
3281
] ) ;
3285
3282
await assertSDKQueryResultsConsistentWithBackend (
3283
+ coll ,
3286
3284
filteredQuery ,
3287
3285
testDocs ,
3288
3286
toIds ( snapshot )
@@ -3296,6 +3294,7 @@ apiDescribe('Database', persistence => {
3296
3294
testDocs [ 'e' ]
3297
3295
] ) ;
3298
3296
await assertSDKQueryResultsConsistentWithBackend (
3297
+ coll ,
3299
3298
filteredQuery ,
3300
3299
testDocs ,
3301
3300
toIds ( snapshot )
@@ -3424,11 +3423,9 @@ apiDescribe('Database', persistence => {
3424
3423
await setDoc ( doc ( coll , 'm' ) , { key : docRef } ) ;
3425
3424
testDocs [ 'm' ] = { key : docRef } ;
3426
3425
3427
- // Populate the cache with all docs first
3428
- await getDocs ( coll ) ;
3429
-
3430
3426
const orderedQuery = query ( coll , orderBy ( 'key' , 'desc' ) ) ;
3431
3427
await assertSDKQueryResultsConsistentWithBackend (
3428
+ coll ,
3432
3429
orderedQuery ,
3433
3430
testDocs ,
3434
3431
[
@@ -3487,11 +3484,9 @@ apiDescribe('Database', persistence => {
3487
3484
settings ,
3488
3485
testDocs ,
3489
3486
async coll => {
3490
- // Populate the cache with all docs first
3491
- await getDocs ( coll ) ;
3492
-
3493
3487
const orderedQuery = query ( coll , orderBy ( 'key' ) ) ;
3494
3488
await assertSDKQueryResultsConsistentWithBackend (
3489
+ coll ,
3495
3490
orderedQuery ,
3496
3491
testDocs ,
3497
3492
[
0 commit comments