Constructor

Key

new Key(options)

Build a Datastore Key object.

Parameter

options

object

Configuration object.

Values in options have the following properties:

Parameter

path

array

Key path.

namespace

Optional

string

Optional namespace.

Example

const Datastore = require('@google-cloud/datastore');
const datastore = new Datastore();
const key = datastore.key({
  namespace: 'ns',
  path: ['Company', 123]
});

Properties

namespace

string

path

array