-
-
Save bennettrogers/138b62de9827119ae58437672d7c7e54 to your computer and use it in GitHub Desktop.
Testing Google Cloud DataStore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before running, install the Google Cloud SDK: | |
// https://cloud.google.com/sdk/docs/ | |
// Then authenticate using: | |
// `gcloud auth application-default login` | |
// Replace `PROJECT-ID` and `ENTITY-NAME` | |
const Datastore = require('@google-cloud/datastore'); | |
const datastore = Datastore({ | |
projectId: 'PROJECT-ID' | |
}); | |
const key = datastore.key(['image', 'ENTITY-NAME']); | |
console.log('this happens immediately'); | |
datastore.get(key, (err, entity) => { | |
console.log('this happens 80 seconds later'); | |
console.log(entity); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment