File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -751,3 +751,22 @@ function gh13957() {
751
751
const repository = new RepositoryBase < ITest > ( TestModel ) ;
752
752
expectType < Promise < ITest [ ] > > ( repository . insertMany ( [ { name : 'test' } ] ) ) ;
753
753
}
754
+
755
+ function gh13897 ( ) {
756
+ interface IDocument {
757
+ name : string ;
758
+ createdAt : Date ;
759
+ updatedAt : Date ;
760
+ }
761
+
762
+ const documentSchema = new Schema < IDocument > ( {
763
+ name : { type : String , required : true }
764
+ } ,
765
+ {
766
+ timestamps : true
767
+ } ) ;
768
+
769
+ const Document = model < IDocument > ( 'Document' , documentSchema ) ;
770
+ const doc = new Document ( { name : 'foo' } ) ;
771
+ expectType < Date > ( doc . createdAt ) ;
772
+ }
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ declare module 'mongoose' {
158
158
AcceptsDiscriminator ,
159
159
IndexManager ,
160
160
SessionStarter {
161
- new < DocType = TRawDocType > ( doc ?: DocType , fields ?: any | null , options ?: boolean | AnyObject ) : THydratedDocumentType ;
161
+ new < DocType = Partial < TRawDocType > > ( doc ?: DocType , fields ?: any | null , options ?: boolean | AnyObject ) : THydratedDocumentType ;
162
162
163
163
aggregate < R = any > ( pipeline ?: PipelineStage [ ] , options ?: AggregateOptions ) : Aggregate < Array < R > > ;
164
164
aggregate < R = any > ( pipeline : PipelineStage [ ] ) : Aggregate < Array < R > > ;
You can’t perform that action at this time.
0 commit comments