File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,7 @@ function gh13878() {
302
302
const User = model ( 'User' , schema ) ;
303
303
const user = new User ( { name : 'John' , age : 30 } ) ;
304
304
expectType < typeof User > ( user . $model ( ) ) ;
305
+ expectType < typeof User > ( user . model ( ) ) ;
305
306
}
306
307
307
308
function gh13094 ( ) {
Original file line number Diff line number Diff line change @@ -192,6 +192,10 @@ declare module 'mongoose' {
192
192
markModified < T extends keyof DocType > ( path : T , scope ?: any ) : void ;
193
193
markModified ( path : string , scope ?: any ) : void ;
194
194
195
+ /** Returns the model with the given name on this document's associated connection. */
196
+ model < ModelType = Model < unknown > > ( name : string ) : ModelType ;
197
+ model < ModelType = Model < DocType > > ( ) : ModelType ;
198
+
195
199
/** Returns the list of paths that have been modified. */
196
200
modifiedPaths ( options ?: { includeChildren ?: boolean } ) : Array < string > ;
197
201
You can’t perform that action at this time.
0 commit comments