I am currently utilizing React 16.3.2, Redux 4, and Dexie 2.0.3.
Every time I attempt to store data for the second time, an error message is thrown.
Error:
ConstraintError: Key already exists in the object store.
return dispatch => {
db.table
.add(data)
.then (function(id){
console.log(id)
})
.catch (function (error) {
console.log("Error: " + error);
});
}
My Database schema:
const db = new Dexie('ReactReduxDexieJsCRUD');
db.version(1).stores({table:'++id,name,age,bloodGroup,donateBefore,weight' });
The first data storage process works fine, but subsequent attempts result in the mentioned error message.