May 2018
Intermediate to advanced
470 pages
13h 54m
English
To store each post, we will first define the Mongoose Schema in server/models/post.model.js. The Post schema will store a post's text content, a photo, a reference to the user who posted, time of creation, likes on the post from users, and comments on the post by users:
text: { type: String, required: 'Name is required'}
photo: { data: Buffer, contentType: String}
Read now
Unlock full access