Skip to content

Instantly share code, notes, and snippets.

@nodirshox
Created November 23, 2020 16:23
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 nodirshox/088207dda8b7dec21e78a3330a9c7eec to your computer and use it in GitHub Desktop.
Save nodirshox/088207dda8b7dec21e78a3330a9c7eec to your computer and use it in GitHub Desktop.
Mongoose schema
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