Tag: uml

外号mongoose

我从mongoose开始,我想知道如何做这种types的configuration: 一个食谱有不同的成分 我得到了我的两个模型: 配料和食谱: var mongoose = require('mongoose'); var Schema = mongoose.Schema; var IngredientSchema = new Schema({ name: String }); module.exports = mongoose.model('Ingredient', IngredientSchema); var mongoose = require('mongoose'); var Schema = mongoose.Schema; var RecipeSchema = new Schema({ name: String }); module.exports = mongoose.model('Recipe', RecipeSchema);