Problems with the updated version of indexeddb

how does indexeddb add or remove indexes from old tables when it is updated?
looked up a lot of information, but only one sentence was mentioned about this piece: it can only be modified in onupgradeneeded. But no one said how to modify it. In
onupgradeneeded, you don"t need a transaction to create a new table, you can just createObjectStore it, and the returned objects can continue to create indexes.
but to get the database that has been created, you need to use a transaction, but in onupgradeneeded, the transaction is invalid, the database version is being upgraded, and an error is reported.
then it starts an endless loop. You can"t get the old table when you upgrade, and you can"t add indexes when you can get the table after the upgrade. So this index is disposable? You can"t move after you"ve created it?


you cannot get the old table when you upgrade, and do not add indexes when you get the table after the upgrade

the index is added at the time of the upgrade, of course.

the problem now is that "old data needs to be indexed".

if you are sure that the old data will not be indexed automatically after the upgrade, you will have to update the old data.


I also encountered this problem. Have you solved it


have you solved

Menu