@@ -901,47 +901,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
901
901
}
902
902
) ;
903
903
904
- validationIt ( persistence , 'with multiple array filters fail' , db => {
905
- expect ( ( ) =>
906
- db
907
- . collection ( 'test' )
908
- . where ( 'foo' , 'array-contains' , 1 )
909
- . where ( 'foo' , 'array-contains' , 2 )
910
- ) . to . throw (
911
- "Invalid query. You cannot use more than one 'array-contains' filter."
912
- ) ;
913
-
914
- expect ( ( ) =>
915
- db
916
- . collection ( 'test' )
917
- . where ( 'foo' , 'array-contains' , 1 )
918
- . where ( 'foo' , 'array-contains-any' , [ 2 , 3 ] )
919
- ) . to . throw (
920
- "Invalid query. You cannot use 'array-contains-any' filters with " +
921
- "'array-contains' filters."
922
- ) ;
923
-
924
- expect ( ( ) =>
925
- db
926
- . collection ( 'test' )
927
- . where ( 'foo' , 'array-contains-any' , [ 2 , 3 ] )
928
- . where ( 'foo' , 'array-contains' , 1 )
929
- ) . to . throw (
930
- "Invalid query. You cannot use 'array-contains' filters with " +
931
- "'array-contains-any' filters."
932
- ) ;
933
-
934
- expect ( ( ) =>
935
- db
936
- . collection ( 'test' )
937
- . where ( 'foo' , 'not-in' , [ 2 , 3 ] )
938
- . where ( 'foo' , 'array-contains' , 1 )
939
- ) . to . throw (
940
- "Invalid query. You cannot use 'array-contains' filters with " +
941
- "'not-in' filters."
942
- ) ;
943
- } ) ;
944
-
945
904
validationIt ( persistence , 'with != and not-in filters fail' , db => {
946
905
expect ( ( ) =>
947
906
db
@@ -963,13 +922,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
963
922
} ) ;
964
923
965
924
validationIt ( persistence , 'with multiple disjunctive filters fail' , db => {
966
- expect ( ( ) =>
967
- db
968
- . collection ( 'test' )
969
- . where ( 'foo' , 'in' , [ 1 , 2 ] )
970
- . where ( 'foo' , 'in' , [ 2 , 3 ] )
971
- ) . to . throw ( "Invalid query. You cannot use more than one 'in' filter." ) ;
972
-
973
925
expect ( ( ) =>
974
926
db
975
927
. collection ( 'test' )
@@ -979,36 +931,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
979
931
"Invalid query. You cannot use more than one 'not-in' filter."
980
932
) ;
981
933
982
- expect ( ( ) =>
983
- db
984
- . collection ( 'test' )
985
- . where ( 'foo' , 'array-contains-any' , [ 1 , 2 ] )
986
- . where ( 'foo' , 'array-contains-any' , [ 2 , 3 ] )
987
- ) . to . throw (
988
- "Invalid query. You cannot use more than one 'array-contains-any'" +
989
- ' filter.'
990
- ) ;
991
-
992
- expect ( ( ) =>
993
- db
994
- . collection ( 'test' )
995
- . where ( 'foo' , 'array-contains-any' , [ 2 , 3 ] )
996
- . where ( 'foo' , 'in' , [ 2 , 3 ] )
997
- ) . to . throw (
998
- "Invalid query. You cannot use 'in' filters with " +
999
- "'array-contains-any' filters."
1000
- ) ;
1001
-
1002
- expect ( ( ) =>
1003
- db
1004
- . collection ( 'test' )
1005
- . where ( 'foo' , 'in' , [ 2 , 3 ] )
1006
- . where ( 'foo' , 'array-contains-any' , [ 2 , 3 ] )
1007
- ) . to . throw (
1008
- "Invalid query. You cannot use 'array-contains-any' filters with " +
1009
- "'in' filters."
1010
- ) ;
1011
-
1012
934
expect ( ( ) =>
1013
935
db
1014
936
. collection ( 'test' )
@@ -1046,51 +968,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
1046
968
) . to . throw (
1047
969
"Invalid query. You cannot use 'not-in' filters with 'in' filters."
1048
970
) ;
1049
-
1050
- // This is redundant with the above tests, but makes sure our validation
1051
- // doesn't get confused.
1052
- expect ( ( ) =>
1053
- db
1054
- . collection ( 'test' )
1055
- . where ( 'foo' , 'in' , [ 2 , 3 ] )
1056
- . where ( 'foo' , 'array-contains' , 1 )
1057
- . where ( 'foo' , 'array-contains-any' , [ 2 ] )
1058
- ) . to . throw (
1059
- "Invalid query. You cannot use 'array-contains-any' filters with 'in' filters."
1060
- ) ;
1061
-
1062
- expect ( ( ) =>
1063
- db
1064
- . collection ( 'test' )
1065
- . where ( 'foo' , 'array-contains' , 1 )
1066
- . where ( 'foo' , 'in' , [ 2 , 3 ] )
1067
- . where ( 'foo' , 'array-contains-any' , [ 2 ] )
1068
- ) . to . throw (
1069
- "Invalid query. You cannot use 'array-contains-any' filters with " +
1070
- "'array-contains' filters."
1071
- ) ;
1072
-
1073
- expect ( ( ) =>
1074
- db
1075
- . collection ( 'test' )
1076
- . where ( 'foo' , 'not-in' , [ 2 , 3 ] )
1077
- . where ( 'foo' , 'array-contains' , 2 )
1078
- . where ( 'foo' , 'array-contains-any' , [ 2 ] )
1079
- ) . to . throw (
1080
- "Invalid query. You cannot use 'array-contains' filters with " +
1081
- "'not-in' filters."
1082
- ) ;
1083
-
1084
- expect ( ( ) =>
1085
- db
1086
- . collection ( 'test' )
1087
- . where ( 'foo' , 'array-contains' , 2 )
1088
- . where ( 'foo' , 'in' , [ 2 ] )
1089
- . where ( 'foo' , 'not-in' , [ 2 , 3 ] )
1090
- ) . to . throw (
1091
- "Invalid query. You cannot use 'not-in' filters with " +
1092
- "'array-contains' filters."
1093
- ) ;
1094
971
} ) ;
1095
972
1096
973
validationIt (
@@ -1110,24 +987,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
1110
987
. where ( 'foo' , 'in' , [ 2 , 3 ] )
1111
988
. where ( 'foo' , 'array-contains' , 1 )
1112
989
) . not . to . throw ( ) ;
1113
-
1114
- expect ( ( ) =>
1115
- db
1116
- . collection ( 'test' )
1117
- . where ( 'foo' , 'in' , [ 2 , 3 ] )
1118
- . where ( 'foo' , 'array-contains' , 1 )
1119
- . where ( 'foo' , 'array-contains' , 2 )
1120
- ) . to . throw (
1121
- "Invalid query. You cannot use more than one 'array-contains' filter."
1122
- ) ;
1123
-
1124
- expect ( ( ) =>
1125
- db
1126
- . collection ( 'test' )
1127
- . where ( 'foo' , 'array-contains' , 1 )
1128
- . where ( 'foo' , 'in' , [ 2 , 3 ] )
1129
- . where ( 'foo' , 'in' , [ 2 , 3 ] )
1130
- ) . to . throw ( "Invalid query. You cannot use more than one 'in' filter." ) ;
1131
990
}
1132
991
) ;
1133
992
@@ -1146,29 +1005,6 @@ apiDescribe('Validation:', (persistence: boolean) => {
1146
1005
"'array-contains-any' filters."
1147
1006
) ;
1148
1007
1149
- expect ( ( ) =>
1150
- db
1151
- . collection ( 'test' )
1152
- // The 10 element max includes duplicates.
1153
- . where ( 'foo' , 'in' , [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 9 , 9 ] )
1154
- ) . to . throw (
1155
- "Invalid Query. 'in' filters support a maximum of 10 elements in " +
1156
- 'the value array.'
1157
- ) ;
1158
-
1159
- expect ( ( ) =>
1160
- db
1161
- . collection ( 'test' )
1162
- . where (
1163
- 'foo' ,
1164
- 'array-contains-any' ,
1165
- [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 9 , 9 ]
1166
- )
1167
- ) . to . throw (
1168
- "Invalid Query. 'array-contains-any' filters support a maximum of " +
1169
- '10 elements in the value array.'
1170
- ) ;
1171
-
1172
1008
expect ( ( ) => db . collection ( 'test' ) . where ( 'foo' , 'in' , [ ] ) ) . to . throw (
1173
1009
"Invalid Query. A non-empty array is required for 'in' filters."
1174
1010
) ;
0 commit comments