So verbinden Sie zwei Modell in Mongoose
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);
Gleaming Gemsbok