Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created October 9, 2018 08:40
Show Gist options
  • Save amandeepmittal/4ef1eda779c0fbf29bc66af46e17905f to your computer and use it in GitHub Desktop.
Save amandeepmittal/4ef1eda779c0fbf29bc66af46e17905f to your computer and use it in GitHub Desktop.
// Books.js
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const bookSchema = new Schema({
title: {
type: String,
required: true
},
author: {
type: String,
required: true
}
});
const Book = mongoose.model('Book', bookSchema);
module.exports = Book;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment