After spending a few hours exploring JsStore and experimenting with the getting started tutorial, I decided to work with the "tutors" database provided on the site. My goal was to insert some data into the database.
var Value = [{TeacherName: "MR. BAUER", Description: "Lane's Teacher"}, {TeacherName: "MRS. BAUMAN", Description: "Lane's Aide"}, {TeacherName: "MRS. STEWART", Description: "Annabelle's Teacher"}, {TeacherName: "MR. GARLAND", Description: "Alex's Teacher"}];
Connection.insert({
Into: "Teachers",
Values: Value,
OnSuccess:function (rowsAffected){
if (rowsAffected > 0)
{
alert('Successfully Added');
}
},
OnError:function (error) {
alert(error.value);
}
});
The insertion process went smoothly. Encouraged by this success, I proceeded to explore the 'bulkInsert' feature, which seemed straightforward based on the documentation.
However, upon clearing the cache and refreshing the page, I encountered the following error:
DOMException: Failed to execute 'add' on 'IDBObjectStore': Evaluating the object store's key path did not yield a value.
I couldn't pinpoint any issues in my code despite making the necessary switch from 'insert' to 'bulkInsert'. Is there an additional step involved in using the bulkInsert method that isn't mentioned in the official documentation?
For a visual demonstration of the issue, you can watch this video sample: https://youtu.be/d-Jxx54c3dw