You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
After creating the first Entity it and try to run the node app according to STEP-6 I get the following error.
Running on http://localhost:8080/
/home/user_name/cloud-nodejs/start/app.js:40
var keyBooks = books.map((book) => Object.assign(book, { id: book.id || book[key].path[1] }));
^
ReferenceError: key is not defined
at books.map (/home/user_name/cloud-nodejs/start/app.js:40:82)
at Array.map (native)
at /home/user_name/cloud-nodejs/start/app.js:40:26
at /home/user_name/cloud-nodejs/start/node_modules/google-cloud/node_modules/@google-cloud/datastore/src/request.js:577:7
.....
Solution:
I works when I change from id = 0 to id = 1 for the entity I created.
cdoger, jojello, CTTeo, iancrowther, flmessier and 2 more