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

hooks.toObject() fails if data is paginated #77

Closed
jack-guy opened this issue Apr 20, 2016 · 4 comments · Fixed by #78
Closed

hooks.toObject() fails if data is paginated #77

jack-guy opened this issue Apr 20, 2016 · 4 comments · Fixed by #78

Comments

@jack-guy
Copy link

The hook only works for mongoose resources on result, not result.data. I'll probably submit a PR shortly.

@jamesjnadeau
Copy link
Contributor

jamesjnadeau commented Apr 20, 2016

This adapter uses the mongoose .lean() functionality when fetching multiple results, that makes using .toObject() not necessary in this case. However, you could configure it to not use lean.

Please take a look at this discussion: #51

@jack-guy
Copy link
Author

jack-guy commented Apr 20, 2016

@jamesjnadeau It defaults to false, and I'd rather not have it apply service-wide. Either way I think the hook should be fixed. Unless you just want to remove the hook entirely @daffl?

@jamesjnadeau
Copy link
Contributor

My mistake then, in my head(and my projects), lean is true by default....

@ekryski
Copy link
Member

ekryski commented Apr 21, 2016

@Harangue yup this is totally valid. Thanks for bringing it up and tackling it Jack!

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

Successfully merging a pull request may close this issue.

3 participants