Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ss-joy opened this issue Sep 14, 2022 · 0 comments

Comments

@ss-joy
Copy link

ss-joy commented Sep 14, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant