Skip to content

Instantly share code, notes, and snippets.

@NALAWALAMURTUZA
Created June 15, 2020 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NALAWALAMURTUZA/cabe14dda408e7b923746d3c984c7811 to your computer and use it in GitHub Desktop.
Save NALAWALAMURTUZA/cabe14dda408e7b923746d3c984c7811 to your computer and use it in GitHub Desktop.
create database shema
interface Test {
code:string;
}
export default Test;
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