Create a news schema in mongoose.
Parameters to be defined in the news schema -
- Title - string
- Content - string
- type - string
- abstract - string
- photos - this will be an array
- timestamp. - object
For timestamp follow the below mentioned pseudo object.
timestamp: {
published_at: timestamp,
created_at: timestamp,
updated_at: timestamp
}
type signifies to which category the particular news belongs to -
Some types for example -
- India news
- geopolitical news
- entertainment news
- political news
- cricket news
Cover all the type of news and create an enum check on them as well.
abstract is similar to the content but in very short format.
Create a news schema in mongoose.
Parameters to be defined in the news schema -
For timestamp follow the below mentioned pseudo object.
type signifies to which category the particular news belongs to -
Some types for example -
Cover all the type of news and create an enum check on them as well.
abstract is similar to the content but in very short format.