const mongoose = require('mongoose');
const passportLocalMongoose = require('passport-local-mongoose');
var UserSchema = new mongoose.Schema({
username: String,
password: String,
repassword: String,
email: String
})
UserSchema.plugin(passportLocalMongoose);
module.exports = mongoose.model("User", UserSchema);
var mongoose = require('mongoose');
var foodSchema = new mongoose.Schema({
name: String,
image: String,
notify: String,
createdAt: {type: Date, default: Date.now},
author: {
id: {
type: mongoose.Schema.Types.ObjectId,
ref: "User"
},
username: String
},
});
module.exports = mongoose.model("food", foodSchema);