@@ -115,11 +115,11 @@ collectionT.find({ 'meta.deep.nested.level': 123 });
115
115
collectionT . find ( { meta : { deep : { nested : { level : 123 } } } } ) ; // no impact on actual nesting
116
116
collectionT . find ( { 'friends.0.name' : 'John' } ) ;
117
117
collectionT . find ( { 'playmates.0.name' : 'John' } ) ;
118
+ // supports arrays with primitive types
119
+ collectionT . find ( { 'treats.0' : 'bone' } ) ;
118
120
119
- // There's an issue with the special BSON types
120
- collectionT . find ( { 'numOfPats.__isLong__' : true } ) ;
121
+ // Handle special BSON types
121
122
collectionT . find ( { numOfPats : Long . fromBigInt ( 2n ) } ) ;
122
- collectionT . find ( { 'playTimePercent.bytes.BYTES_PER_ELEMENT' : 1 } ) ;
123
123
collectionT . find ( { playTimePercent : new Decimal128 ( '123.2' ) } ) ;
124
124
125
125
// works with some extreme indexes
@@ -135,10 +135,12 @@ expectNotType<Filter<PetModel>>({ 'meta.deep.nested.level': true });
135
135
expectNotType < Filter < PetModel > > ( { 'meta.deep.nested.level' : new Date ( ) } ) ;
136
136
expectNotType < Filter < PetModel > > ( { 'friends.0.name' : 123 } ) ;
137
137
expectNotType < 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 } ) ;
138
141
139
142
// 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' } ) ;
142
144
143
145
/// it should query __array__ fields by exact match
144
146
await collectionT . find ( { treats : [ 'kibble' , 'bone' ] } ) . toArray ( ) ;
0 commit comments