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

Proposal for performance: Refactor documents #5

Open
ghost opened this issue Aug 26, 2020 · 0 comments
Open

Proposal for performance: Refactor documents #5

ghost opened this issue Aug 26, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Aug 26, 2020

the flow from http request goes like: JSON -> DTO -> Document -> Document -> DTO -> JSON
A suggestion would be to go JSON -> Document -> Json, Skipp the DTO.
The proposal then is to have a .validate(document) on a dto-like struct, this will make is possible to go [DTO]::validate(document).
This validate method can be generated using a Macro, this macro cleans and makes sure the fields in the document is correct.

Downside: the document struct is a mongodb struct, making is less clean than breaking it out.
Upside: Performance will increase.

@ghost ghost added the enhancement New feature or request label Aug 26, 2020
@ghost ghost changed the title Performance: Refactor documents Proposal for performance: Refactor documents Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

0 participants