Instantly share code, notes, and snippets.

What would you like to do?
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
notice there is no ID. That's because Mongoose will assign
an ID by default to all schemas
const GadgetSchema = new Schema({
name: String,
release_date: Date,
by_company: String,
price: Number,
module.exports = mongoose.model('Gadget', GadgetSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment