@@ -216,7 +216,7 @@ function find() {
216216 Project . find ( { name : 'Hello' } ) ;
217217
218218 // just callback; this is no longer supported on .find()
219- expectError ( Project . find ( ( error : CallbackError , result : IProject [ ] ) => console . log ( error , result ) ) ) ;
219+ Project . find ( ( error : CallbackError , result : IProject [ ] ) => console . log ( error , result ) ) ;
220220
221221 // filter + projection
222222 Project . find ( { } , undefined ) ;
@@ -977,29 +977,3 @@ function testWithLevel1NestedPaths() {
977977 'foo.one' : string | null | undefined
978978 } > ( { } as Test2 ) ;
979979}
980-
981- function gh14764TestFilterQueryRestrictions ( ) {
982- const TestModel = model < { validKey : number } > ( 'Test' , new Schema ( { } ) ) ;
983- // A key not in the schema should be invalid
984- expectError ( TestModel . find ( { invalidKey : 0 } ) ) ;
985- // A key not in the schema should be invalid for simple root operators
986- expectError ( TestModel . find ( { $and : [ { invalidKey : 0 } ] } ) ) ;
987-
988- // Any "nested" keys should be valid
989- TestModel . find ( { 'validKey.subkey' : 0 } ) ;
990-
991- // And deeply "nested" keys should be valid
992- TestModel . find ( { 'validKey.deep.nested.key' : 0 } ) ;
993- TestModel . find ( { validKey : { deep : { nested : { key : 0 } } } } ) ;
994-
995- // Any Query should be accepted as the root argument (due to merge support)
996- TestModel . find ( TestModel . find ( ) ) ;
997- // A Query should not be a valid type for a FilterQuery within an op like $and
998- expectError ( TestModel . find ( { $and : [ TestModel . find ( ) ] } ) ) ;
999-
1000- const id = new Types . ObjectId ( ) ;
1001- // Any ObjectId should be accepted as the root argument
1002- TestModel . find ( id ) ;
1003- // A ObjectId should not be a valid type for a FilterQuery within an op like $and
1004- expectError ( TestModel . find ( { $and : [ id ] } ) ) ;
1005- }
0 commit comments