song.js 381 B

1234567891011121314
  1. module.exports = mongoose => {
  2. const Schema = mongoose.Schema;
  3. const songSchema = new Schema({
  4. id: { type: String, length: 11, index: true, unique: true, required: true },
  5. title: { type: String, required: true },
  6. artists: [{ type: String, min: 1 }],
  7. duration: { type: Number, required: true },
  8. thumbnail: { type: String, required: true }
  9. });
  10. return songSchema;
  11. };