method Query.prototype.groupBy Query.prototype.groupBy(fieldNames: string | string[]): this Group query results by a list of properties. Examples Example 1 const {Datastore} = require('@google-cloud/datastore'); const datastore = new Datastore(); const companyQuery = datastore.createQuery('Company'); const groupedQuery = companyQuery.groupBy(['name', 'size']); Parameters fieldNames: string | string[] Return Type this