diff --git a/appengine/datastore/app.js b/appengine/datastore/app.js index b25d022065..319c12cbbd 100644 --- a/appengine/datastore/app.js +++ b/appengine/datastore/app.js @@ -27,10 +27,10 @@ app.enable('trust proxy'); // the project specified by the GOOGLE_CLOUD_PROJECT environment variable. See // https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/docs/authentication.md // These environment variables are set automatically on Google App Engine -const Datastore = require('@google-cloud/datastore'); +const {Datastore} = require('@google-cloud/datastore'); // Instantiate a datastore client -const datastore = Datastore(); +const datastore = new Datastore(); /** * Insert a visit record into the database. diff --git a/appengine/datastore/package.json b/appengine/datastore/package.json index dd2f2622ee..f6f29caa75 100644 --- a/appengine/datastore/package.json +++ b/appengine/datastore/package.json @@ -18,7 +18,7 @@ "test": "npm run system-test" }, "dependencies": { - "@google-cloud/datastore": "^2.0.0", + "@google-cloud/datastore": "^3.0.0", "express": "^4.16.4" }, "devDependencies": { diff --git a/functions/datastore/index.js b/functions/datastore/index.js index 6516974576..1d33d48cba 100644 --- a/functions/datastore/index.js +++ b/functions/datastore/index.js @@ -15,10 +15,10 @@ 'use strict'; -const Datastore = require('@google-cloud/datastore'); +const {Datastore} = require('@google-cloud/datastore'); // Instantiates a client -const datastore = Datastore(); +const datastore = new Datastore(); /** * Gets a Datastore key from the kind/key pair in the request. diff --git a/functions/datastore/package.json b/functions/datastore/package.json index 63482cc466..0081821ae6 100644 --- a/functions/datastore/package.json +++ b/functions/datastore/package.json @@ -17,7 +17,7 @@ "test": "npm run system-test" }, "dependencies": { - "@google-cloud/datastore": "2.0.0", + "@google-cloud/datastore": "3.1.2", "supertest": "^3.0.0" }, "devDependencies": { diff --git a/functions/datastore/test/index.test.js b/functions/datastore/test/index.test.js index ed2964f5e2..e1154b9cf6 100644 --- a/functions/datastore/test/index.test.js +++ b/functions/datastore/test/index.test.js @@ -16,8 +16,8 @@ 'use strict'; const assert = require('assert'); -const Datastore = require('@google-cloud/datastore'); -const datastore = Datastore(); +const {Datastore} = require('@google-cloud/datastore'); +const datastore = new Datastore(); const program = require('../'); const uuid = require('uuid');