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

Decide on the best technique for sanitizing data before sending to client #438

Open
iampava opened this issue Nov 27, 2021 · 0 comments
Open
Assignees
Labels
BackEnd enhancement New feature or request

Comments

@iampava
Copy link
Collaborator

iampava commented Nov 27, 2021

When querying MongoDB data we don't want to send everything to the client (eg: password, _id).

Right now we have a somewhat functional approach by declaring functions and deleting from them. Maybe we should try extending the Schema.toJSON() method: https://contactsunny.medium.com/hide-properties-of-mongoose-objects-in-node-js-json-responses-a5437a5dbec2

@iampava iampava self-assigned this Nov 27, 2021
@iampava iampava added BackEnd enhancement New feature or request labels Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BackEnd enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant