title: How to get the key of indexeddb to be use in put function
body: <p>I am trying to get the key of specific record in indexedDb to be updated. I searched all over the place including IDB's own documentation and have yet to find what I am looking for.</p>
  
  <p>This here is my database ->
  <a href="https://i.stack.imgur.com/NUp7C.jpg" rel="nofollow noreferrer">IndexedDB records</a></p>
  
  <p>What I am trying to do in the code below is to grab the keyPath 'id' value to be used to grab the specified record to be updated with the put function.</p>
  
  <pre><code>//Save page when choosen
  var cv = document.getElementById('myCanvas');
      let bits = cv.toDataURL("image/png");
  
      let ob = {
          created: new Date(),
          data: bits
      };
  
      let trans = db.transaction([currentNotebook], 'readwrite');
  
      let key = trans.objectStore(currentNotebook).get(getAllKeysRequest.result[currentPage]);
  
      let editReq = trans.objectStore(currentNotebook).put(ob, key);
  
      editReq.onerror = function (e) {
          console.log('error storing data');
          console.error(e);
      }
  </code></pre>
  
  <p>An error occur saying when the above code is being run</p>
  
  <pre><code>&lt;font cUncaught DOMException: Failed to execute 'put' on 'IDBObjectStore': The object store uses in-line keys and the key parameter was provided.
  </code></pre>