playlist.js 822 B

12345678910111213141516171819202122
  1. import mongoose from "mongoose";
  2. export default {
  3. displayName: { type: String, min: 2, max: 32, trim: true, required: true },
  4. songs: [
  5. {
  6. _id: { type: mongoose.Schema.Types.ObjectId, required: false },
  7. youtubeId: { type: String },
  8. title: { type: String },
  9. duration: { type: Number },
  10. thumbnail: { type: String, required: false },
  11. artists: { type: Array, required: false },
  12. status: { type: String }
  13. }
  14. ],
  15. createdBy: { type: String, required: true },
  16. createdAt: { type: Date, default: Date.now, required: true },
  17. createdFor: { type: String },
  18. privacy: { type: String, enum: ["public", "private"], default: "private" },
  19. type: { type: String, enum: ["user", "user-liked", "user-disliked", "genre", "station"], required: true },
  20. documentVersion: { type: Number, default: 6, required: true }
  21. };