Update
This commit is contained in:
parent
b92456d8d3
commit
b6130a7268
29 changed files with 16 additions and 779 deletions
|
|
@ -1,17 +0,0 @@
|
|||
module.exports = mongoose => {
|
||||
let schema = mongoose.Schema({
|
||||
userId: String,
|
||||
name: String,
|
||||
videos: Array
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
schema.method("toJSON", function() {
|
||||
const { __v, _id, ...object } = this.toObject();
|
||||
object.id = _id;
|
||||
return object;
|
||||
});
|
||||
|
||||
return mongoose.model("playlist", schema);
|
||||
};
|
||||
Reference in a new issue