module
@google-cloud/datastore
Source: index.
The default export of the @google-cloud/datastore package is the
Datastore class.
See the Datastore class for client methods and configuration options.
Examples
<caption>Install the client library with <a
href="https://www.npmjs.com/">npm</a>:</caption> npm install --save
Import the client library
const {Datastore} = require('@google-cloud/datastore');
<caption>Create a client that uses <a
href="https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application">Application
Default Credentials (ADC)</a>:</caption> const datastore = new Datastore();
<caption>Create a client with <a
href="https://cloud.google.com/docs/authentication/production#obtaining_and_providing_service_account_credentials_manually">explicit
credentials</a>:</caption> const datastore = new Datastore({ projectId:
'your-project-id', keyFilename: '/path/to/keyfile.json'
});
include:samples/quickstart.js
region_tag:datastore_quickstart
Full quickstart example:
Property
Property
static
v1 object
Property
| Name | Type | Optional | Description |
|---|---|---|---|
|
DatastoreClient |
constructor |
|
Reference to v1.DatastoreClient. |
- See also
- v1.DatastoreClient