| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/API/IDBObjectStore | [Back] [Original] |
Get to know MDN better
IDBObjectStore.indexNames IDBObjectStore.keyPath IDBObjectStore.nameIDBObjectStore.transaction IDBObjectStore.autoIncrement IDBObjectStore.add()IDBRequest value
IDBObjectStore.clear()IDBObjectStore.count()IDBObjectStore.createIndex()IDBObjectStore.delete()IDBObjectStore.deleteIndex()IDBObjectStore.get()IDBObjectStore.getKey()IDBObjectStore.getAll()IDBObjectStore.getAllKeys()IDBObjectStore.index()IDBObjectStore.openCursor()IDBObjectStore.openKeyCursor()IDBObjectStore.put()IDBRequest value readwrite
onupgradeneeded IDBObjectStore.createIndex IDBObjectStore.add To-do Notifications ()
//
const DBOpenRequest = window.indexedDB.open("toDoList", 4);
DBOpenRequest.onsuccess = (event) => {
note.innerHTML += "<li></li>";
// db
db = DBOpenRequest.result;
};
//
// window.indexedDB.open
//
//
DBOpenRequest.onupgradeneeded = (event) => {
const db = event.target.result;
db.onerror = (event) => {
note.innerHTML +=
"<li></li>";
};
// objectStore
const objectStore = db.createObjectStore("toDoList", {
keyPath: "taskTitle",
});
// objectStore
objectStore.createIndex("hours", "hours", { unique: false });
objectStore.createIndex("minutes", "minutes", { unique: false });
objectStore.createIndex("day", "day", { unique: false });
objectStore.createIndex("month", "month", { unique: false });
objectStore.createIndex("year", "year", { unique: false });
objectStore.createIndex("notified", "notified", { unique: false });
note.innerHTML += "<li></li>";
};
//
const newItem = [
{
taskTitle: "Walk dog",
hours: 19,
minutes: 30,
day: 24,
month: "December",
year: 2013,
notified: "no",
},
];
//
const transaction = db.transaction(["toDoList"], "readwrite");
//
transaction.oncomplete = (event) => {
note.innerHTML += "<li></li>";
};
transaction.onerror = (event) => {
note.innerHTML +=
"<li></li>";
};
//
const objectStore = transaction.objectStore("toDoList");
// newItem
const objectStoreRequest = objectStore.add(newItem[0]);
objectStoreRequest.onsuccess = (event) => {
note.innerHTML += "<li></li>";
};
| Indexed Database API 3.0 # object-store-interface |
IDBObjectStore| Web Proxy Viewer | New URL | Original Page |