Closed dorukgunes closed 7 years ago
Did you try toJSON? Or maybe with Query#lean when querying the documents?
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.
@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)
Closed by #8
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.