Id are changing with Redis engine
Since #44 was closed, I open this issue. The data is OK except it generates a new Id for some reason. Any simple example will show the bug.
Is every id for every record changing?
Does the id change to something different every time you read from the cache, or is the new id consistent every time you read from the cache?
If you clear redis and cache the results again, is the new id the same as it was before? Or does it generate a brand new id that is different than the previous brand new id?
Yes
Every time is different, I suspect that mongoose rejects the string and generates a fresh one. On every cache read. The data in the cache is correct though.
EDIT: images

What version of Mongoose are you using?
v5.4.1
I just published 8.0.0. I had to introduce a breaking change (dropping support for older versions), but I believe this will fix the problem. I will wait to hear back from you before closing this issue.
Just tested, now the ID is null. I did a full refresh to be sure. Data is still ok in the redis cache.

same here
So... unresolved? I just started caching a new query and I'm seeing the same results, all of the data is present and correct except the id field is null for every document. If I remove the .cache from the mongoose query chain it goes back to a correctly populated id field.
same here