次のように 1 つのオブジェクトストアが宣言されている indexeddb データベースがあるとします。
var objectStore = thisDb.createObjectStore("table", {keyPath: "id", autoIncrement: true})
追加リクエストで新しいアイテムを追加すると:
var resp = objectStore.add(row)
onsuccess 関数でこの追加されたアイテムの新しい ID を取得するにはどうすればよいですか?
resp.onsuccess = function(e) { /* code to get the id of the added item */}