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

Id are changing with Redis engine #49

Open
Sytten opened this issue Jan 18, 2019 · 9 comments
Open

Id are changing with Redis engine #49

Sytten opened this issue Jan 18, 2019 · 9 comments

Comments

@Sytten
Copy link

Sytten commented Jan 18, 2019

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.

@boblauer
Copy link
Owner

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?

@Sytten
Copy link
Author

Sytten commented Jan 18, 2019

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
screen shot 2019-01-17 at 11 39 30 pm
screen shot 2019-01-17 at 11 40 14 pm

@boblauer
Copy link
Owner

What version of Mongoose are you using?

@Sytten
Copy link
Author

Sytten commented Jan 18, 2019

v5.4.1

@boblauer
Copy link
Owner

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.

@Sytten
Copy link
Author

Sytten commented Jan 18, 2019

Just tested, now the ID is null. I did a full refresh to be sure. Data is still ok in the redis cache.
screen shot 2019-01-18 at 1 40 19 pm

@ozanmanav
Copy link

same here

@webshooter
Copy link

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.

@smnfsc
Copy link

smnfsc commented Apr 22, 2020

same here

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

5 participants