Created
November 23, 2020 16:23
-
-
Save nodirshox/088207dda8b7dec21e78a3330a9c7eec to your computer and use it in GitHub Desktop.
Mongoose schema
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
const mongoose = require('mongoose') | |
var TaskSchema = new mongoose.Schema({ | |
title: { | |
type: String, | |
required: true | |
}, | |
body: { | |
type: String, | |
default: '' | |
}, | |
is_active: { | |
type: Boolean, | |
default: true | |
} | |
}); | |
module.exports = mongoose.model('Task', TaskSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment