techfort / LokiJS

javascript embeddable / in-memory database
http:/techfort.github.io/LokiJS
MIT License
6.71k stars 478 forks source link

Corrupted idIndex and $loki value #912

Open Miky88 opened 1 year ago

Miky88 commented 1 year ago

Issue #881 clearly shows the problem and it's still not fixed. Basically the idIndex gets duplicate references and update throws a "Trying to update a document not in collection" error

Losses commented 1 year ago

I'm wondering why this happened, since many things of this library is buggy, I did a lot of research about the source code, if there're more detailed scenario about the issue, we may find the solution.

For my case, all the data with duplicated key are the same, they are simply inserted twice, what about your case?