You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
multi-model/models/authors.js

12 lines
241 B

var mongoose = require('mongoose');
var Article = require('./articles.js');
var authorSchema = mongoose.Schema({
name: String,
articles: [Article.schema]
});
var author = mongoose.model('Author', authorSchema);
module.exports = author;