Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Properly serialize/deserialize mongoose documents to/from cache #109

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

Open
doronrk wants to merge 1 commit into GraphQLGuide:master
base: master
Choose a base branch
Loading
from TradeWing:drk/serialize-documents

Conversation

@doronrk
Copy link

@doronrk doronrk commented Sep 19, 2022

@lorensr How does this look to you? This is fully backwards compatible. Code expecting mongoose documents to be returned from the find... methods will not break. toObject is called only before serializing to the cache, not on the return value. When a document is deserialized from the cache, mongoose.Model.hydrate is called on the result as well because the API expects a mongoose document in this case.

Happy to address any feedback in the approach, let me know.

Copy link
Author

doronrk commented Sep 26, 2022

@lorensr Just following up here. I can add unit tests and make changes, but wanted to first get your input on the high level approach before spending additional time.

Copy link
Member

lorensr commented Oct 8, 2022

Hey @doronrk, sorry for the wait—code looks good, tests sound good ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /