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

Notepack mongoose object problem #5

Closed
dorukgunes opened this issue Jul 4, 2017 · 4 comments
Closed

Notepack mongoose object problem #5

dorukgunes opened this issue Jul 4, 2017 · 4 comments
Milestone

Comments

@dorukgunes
Copy link

Do you know any elegant way to encode and mongoose object with notepack ? I get a RangeError: Maximum call stack size exceeded when i try to encode and mongoose object.

@darrachequesne
Copy link
Owner

Did you try toJSON? Or maybe with Query#lean when querying the documents?

@dorukgunes
Copy link
Author

That works but in our project it is complicated to change our queries into lean, i am writing this about socket-io redis because in version 5 it uses notepack, before notepack there is no problem with encoding mongoose object. Dou you have any idea how i can change the encoder of socket-io.redis or come over this problem without changing every query.

@darrachequesne
Copy link
Owner

@dorukgunes and what about toJSON? It seems msgpack-lite does not call toJSON() method when available, but msgpack-js does (there):

if('function' === typeof value.toJSON)
  return encode(value.toJSON(), buffer, offset)

@darrachequesne
Copy link
Owner

Closed by #8

@darrachequesne darrachequesne added this to the 2.1.0 milestone Jul 31, 2017
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

2 participants