I am starting to play around with node.js, express, mongo and all that good stuff. I can't figure out how to define mongoose Schema for a JSON file like this:
[
{
"artist" : "Lorem",
"profile-picture": "/lorem.jpg",
"bio": "Lorem ipsum dolor sit amet, consectetur.",
"songs": [
{
"id": 0,
"name": "Lorem ipsum",
"url": "/lorem.mp3",
"length": 34,
"rating": {
"likes": 3,
"likes-timestamps": [
1436822318,
1436822321,
1436822334
]
}
}
]
}
]
In every tutorial I came across, it's just too simplified to something like this:
MySchema = new Schema({
name: String
});
And I am not sure about nesting those objects and arrays, etc. Thanks in advance.