cachegoose icon indicating copy to clipboard operation
cachegoose copied to clipboard

Id are changing with Redis engine

Open Sytten opened this issue 6 years ago • 9 comments

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.

Sytten avatar Jan 18 '19 04:01 Sytten

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?

boblauer avatar Jan 18 '19 04:01 boblauer

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

Sytten avatar Jan 18 '19 04:01 Sytten

What version of Mongoose are you using?

boblauer avatar Jan 18 '19 16:01 boblauer

v5.4.1

Sytten avatar Jan 18 '19 16:01 Sytten

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.

boblauer avatar Jan 18 '19 17:01 boblauer

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

Sytten avatar Jan 18 '19 18:01 Sytten

same here

ozanmanav avatar Mar 11 '19 12:03 ozanmanav

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.

webshooter avatar Jan 19 '20 00:01 webshooter

same here

smnfsc avatar Apr 22 '20 00:04 smnfsc