Skip to content

For route "/posts/:id/edit" projection on Db doesn't work(gets everything about a post.) #15

@ss-joy

Description

@ss-joy

In branch 26.nodejs-mondodb ,in 06-updating-documents/routes/blog.js,
in the blog,js file we created a GET route "/posts/:id/edit" to get a specific post from the post collection so that we can later populate a 'update-post' html page for the users to edit their posts.

We used projection in the find() method to only get a few parts from a post.Because getting all parts of a post is not necessary.But the projection is not working.It is getting all the information about a post.

For example:
Here we set the projection to get only title,body and summary.But when I console log it I get all the infromation about a post!!
Is there something wrong with the projection??

2022-09-14_16-03
ok

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