const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;
const Article = new Schema({
title: {
type: String,
unique: true,
required: [true, 'Article must have title']
},
author: {
type: ObjectId,
ref: 'User'
}
});
module.exports = mongoose....