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

Method getResultList

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

* Executes the query, returning array of results mapped to entity instances.

(limit?: number)

Source from the content-addressed store, hash-verified

2595 * Executes the query, returning array of results mapped to entity instances.
2596 */
2597 async getResultList(limit?: number): Promise<Loaded<Entity, Hint, Fields>[]> {
2598 await this.em!.tryFlush(this.mainAlias.entityName, { flushMode: this.#state.flushMode });
2599 const res = await this.execute<EntityData<Entity>[]>('all', true);
2600 return this.mapResults(res, limit);
2601 }
2602
2603 private propagatePopulateHint<U extends object>(entity: U, hint: PopulateOptions<U>[]) {
2604 helper(entity).__serializationContext.populate = hint.concat(helper(entity).__serializationContext.populate ?? []);

Calls 2

mapResultsMethod · 0.95
tryFlushMethod · 0.80

Tested by

no test coverage detected