Skip to content

Creating a news schema in mongoose #27

@himanshusanecha

Description

@himanshusanecha

Create a news schema in mongoose.

Parameters to be defined in the news schema -

  1. Title - string
  2. Content - string
  3. type - string
  4. abstract - string
  5. photos - this will be an array
  6. 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 -

  1. India news
  2. geopolitical news
  3. entertainment news
  4. political news
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions