@@ -119,11 +119,11 @@ collectionT.find({ 'meta.deep.nested.level': 123 });
119119collectionT . find ( { meta : { deep : { nested : { level : 123 } } } } ) ; // no impact on actual nesting
120120collectionT . find ( { 'friends.0.name' : 'John' } ) ;
121121collectionT . find ( { 'playmates.0.name' : 'John' } ) ;
122+ // supports arrays with primitive types
123+ collectionT . find ( { 'treats.0' : 'bone' } ) ;
122124
123- // There's an issue with the special BSON types
124- collectionT . find ( { 'numOfPats.__isLong__' : true } ) ;
125+ // Handle special BSON types
125126collectionT . find ( { numOfPats : Long . fromBigInt ( 2n ) } ) ;
126- collectionT . find ( { 'playTimePercent.bytes.BYTES_PER_ELEMENT' : 1 } ) ;
127127collectionT . find ( { playTimePercent : new Decimal128 ( '123.2' ) } ) ;
128128
129129// works with some extreme indexes
@@ -139,10 +139,12 @@ expectNotType<Filter<PetModel>>({ 'meta.deep.nested.level': true });
139139expectNotType < Filter < PetModel > > ( { 'meta.deep.nested.level' : new Date ( ) } ) ;
140140expectNotType < Filter < PetModel > > ( { 'friends.0.name' : 123 } ) ;
141141expectNotType < 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 } ) ;
142145
143146// 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' } ) ;
146148
147149/// it should query __array__ fields by exact match
148150await collectionT . find ( { treats : [ 'kibble' , 'bone' ] } ) . toArray ( ) ;
0 commit comments