Created
June 15, 2020 13:42
-
-
Save NALAWALAMURTUZA/cabe14dda408e7b923746d3c984c7811 to your computer and use it in GitHub Desktop.
create database shema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Test { | |
code:string; | |
} | |
export default Test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as mongoose from 'mongoose'; | |
import Test from './test.interface'; | |
const schema = new mongoose.Schema({ | |
code: Number, | |
}, { | |
timestamps: true, | |
}); | |
const testModel = mongoose.model<Test & mongoose.Document>('Test', schema); | |
export default testModel; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment