method Datastore.int
Datastore.int(value: number | string): entity.Int

Helper function to get a Datastore Integer object.

This is also useful when using an ID outside the bounds of a JavaScript Number object.

Examples

Example 1

const {Datastore} = require('@google-cloud/datastore');
const datastore = new Datastore();
const sevenInteger = datastore.int(7);

//-
// Create an Int to support long Key IDs.
//-
const key = datastore.key([
  'Kind',
  datastore.int('100000000000001234')
]);

Parameters

value: number | string

The integer value.

Return Type

entity.Int

Usage

import { Datastore } from ".";