@@ -119,11 +119,11 @@ collectionT.find({ 'meta.deep.nested.level': 123 });
119
119
collectionT . find ( { meta : { deep : { nested : { level : 123 } } } } ) ; // no impact on actual nesting
120
120
collectionT . find ( { 'friends.0.name' : 'John' } ) ;
121
121
collectionT . find ( { 'playmates.0.name' : 'John' } ) ;
122
+ // supports arrays with primitive types
123
+ collectionT . find ( { 'treats.0' : 'bone' } ) ;
122
124
123
- // There's an issue with the special BSON types
124
- collectionT . find ( { 'numOfPats.__isLong__' : true } ) ;
125
+ // Handle special BSON types
125
126
collectionT . find ( { numOfPats : Long . fromBigInt ( 2n ) } ) ;
126
- collectionT . find ( { 'playTimePercent.bytes.BYTES_PER_ELEMENT' : 1 } ) ;
127
127
collectionT . find ( { playTimePercent : new Decimal128 ( '123.2' ) } ) ;
128
128
129
129
// works with some extreme indexes
@@ -139,10 +139,12 @@ expectNotType<Filter<PetModel>>({ 'meta.deep.nested.level': true });
139
139
expectNotType < Filter < PetModel > > ( { 'meta.deep.nested.level' : new Date ( ) } ) ;
140
140
expectNotType < Filter < PetModel > > ( { 'friends.0.name' : 123 } ) ;
141
141
expectNotType < Filter < PetModel > > ( { 'playmates.0.name' : 123 } ) ;
142
+ expectNotType < Filter < PetModel > > ( { 'treats.0' : 123 } ) ;
143
+ expectNotType < Filter < PetModel > > ( { 'numOfPats.__isLong__' : true } ) ;
144
+ expectNotType < Filter < PetModel > > ( { 'playTimePercent.bytes.BYTES_PER_ELEMENT' : 1 } ) ;
142
145
143
146
// Nested arrays aren't checked
144
- expectType < Filter < PetModel > > ( { 'meta.deep.nestedArray.0' : 'not a number' } ) ;
145
- expectNotType < Filter < PetModel > > ( { 'meta.deep.nestedArray.23' : 'not a number' } ) ;
147
+ expectNotType < Filter < PetModel > > ( { 'meta.deep.nestedArray.0' : 'not a number' } ) ;
146
148
147
149
/// it should query __array__ fields by exact match
148
150
await collectionT . find ( { treats : [ 'kibble' , 'bone' ] } ) . toArray ( ) ;
0 commit comments