19 lines
370 B
TypeScript
19 lines
370 B
TypeScript
import mongoose from 'mongoose';
|
|
|
|
const playlistSchema = new mongoose.Schema({
|
|
id: String,
|
|
name: String,
|
|
type: {
|
|
type: String,
|
|
enum: ['playlist', 'folder'],
|
|
required: true
|
|
},
|
|
tracks: [String],
|
|
children: [{
|
|
type: mongoose.Schema.Types.Mixed
|
|
}]
|
|
}, {
|
|
timestamps: true
|
|
});
|
|
|
|
export const Playlist = mongoose.model('Playlist', playlistSchema);
|