Skip to content

Instantly share code, notes, and snippets.

@beaucarnes
Created April 29, 2019 13:33
Show Gist options
  • Save beaucarnes/8372fe153a55acc1b8b0997f860b9ebf to your computer and use it in GitHub Desktop.
Save beaucarnes/8372fe153a55acc1b8b0997f860b9ebf to your computer and use it in GitHub Desktop.
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const exerciseSchema = new Schema({
username: { type: String, required: true },
description: { type: String, required: true },
duration: { type: Number, required: true },
date: { type: Date, required: true },
}, {
timestamps: true,
});
const Exercise = mongoose.model('Exercise', exerciseSchema);
module.exports = Exercise;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment