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