MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / getResultAndCount

Method getResultAndCount

packages/sql/src/query/QueryBuilder.ts:2693–2695  ·  view source on GitHub ↗

* Executes the query, returning both array of results and total count query (without offset and limit).

()

Source from the content-addressed store, hash-verified

2691 * Executes the query, returning both array of results and total count query (without offset and limit).
2692 */
2693 async getResultAndCount(): Promise<[Loaded<Entity, Hint, Fields>[], number]> {
2694 return [await this.clone().getResultList(), await this.clone().getCount()];
2695 }
2696
2697 /**
2698 * Returns native query builder instance with sub-query aliased with given alias.

Calls 3

cloneMethod · 0.95
getResultListMethod · 0.80
getCountMethod · 0.80

Tested by

no test coverage detected