method Query.prototype.limit
Query.prototype.limit(n: number): this

Set a limit on a query.

Examples

Example 1

const {Datastore} = require('@google-cloud/datastore');
const datastore = new Datastore();
const companyQuery = datastore.createQuery('Company');

// Limit the results to 10 entities.
const limitQuery = companyQuery.limit(10);

Parameters

n: number

The number of results to limit the query to.

Return Type

this

See

Usage

import { Query } from ".";