@@ -115,11 +115,11 @@ collectionT.find({ 'meta.deep.nested.level': 123 });
115115collectionT . find ( { meta : { deep : { nested : { level : 123 } } } } ) ; // no impact on actual nesting
116116collectionT . find ( { 'friends.0.name' : 'John' } ) ;
117117collectionT . find ( { 'playmates.0.name' : 'John' } ) ;
118+ // supports arrays with primitive types
119+ collectionT . find ( { 'treats.0' : 'bone' } ) ;
118120
119- // There's an issue with the special BSON types
120- collectionT . find ( { 'numOfPats.__isLong__' : true } ) ;
121+ // Handle special BSON types
121122collectionT . find ( { numOfPats : Long . fromBigInt ( 2n ) } ) ;
122- collectionT . find ( { 'playTimePercent.bytes.BYTES_PER_ELEMENT' : 1 } ) ;
123123collectionT . find ( { playTimePercent : new Decimal128 ( '123.2' ) } ) ;
124124
125125// works with some extreme indexes
@@ -135,10 +135,12 @@ expectNotType<Filter<PetModel>>({ 'meta.deep.nested.level': true });
135135expectNotType < Filter < PetModel > > ( { 'meta.deep.nested.level' : new Date ( ) } ) ;
136136expectNotType < Filter < PetModel > > ( { 'friends.0.name' : 123 } ) ;
137137expectNotType < Filter < PetModel > > ( { 'playmates.0.name' : 123 } ) ;
138+ expectNotType < Filter < PetModel > > ( { 'treats.0' : 123 } ) ;
139+ expectNotType < Filter < PetModel > > ( { 'numOfPats.__isLong__' : true } ) ;
140+ expectNotType < Filter < PetModel > > ( { 'playTimePercent.bytes.BYTES_PER_ELEMENT' : 1 } ) ;
138141
139142// Nested arrays aren't checked
140- expectType < Filter < PetModel > > ( { 'meta.deep.nestedArray.0' : 'not a number' } ) ;
141- expectNotType < Filter < PetModel > > ( { 'meta.deep.nestedArray.23' : 'not a number' } ) ;
143+ expectNotType < Filter < PetModel > > ( { 'meta.deep.nestedArray.0' : 'not a number' } ) ;
142144
143145/// it should query __array__ fields by exact match
144146await collectionT . find ( { treats : [ 'kibble' , 'bone' ] } ) . toArray ( ) ;
0 commit comments