I am trying to print the objects primary key in IndexedDB to the console.
I've seen two examples that use 'Cursor.Value.Key' but when I use that I get 'undefined'.
if (cursor)
{
console.log(cursor.value.key);
console.log(cursor.value.username);
console.log(username)
console.log(cursor.value.password);
console.log(password)
This is my database
objectStore = db.createObjectStore('users', { keyPath: "id", autoIncrement: true });
objectStore.createIndex('username', 'username', { unique: true });
objectStore.createIndex('password', 'password', {unique: false});
It should print the objects primary key, ie 1 or 2