I am trying to use datastore emulator with my nodejs application
Initially I have followed the instructions given in here
Then in my node application :-
var config = {
projectId : "scio1-ts-datastore"
}
const datastore = require("@google-cloud/datastore")
const db = new datastore.Datastore(config)
const setdata = async () => {
await db.save(({
key : db.key('orders') ,
data : {
orderId : 1 ,
orderType : "Hazardous"
}
}))
}
const getdata = async () => {
const query = db.createQuery('orders')
const [orders] = await db.runQuery(query)
console.log(orders)
}
setdata()
getdata()
After this I had to run gcloud auth application-default login which I think is not needed to run as I am using datastore Emulator .
But even after this I am unable to run the app