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

Method findVirtual

packages/mongodb/src/MongoDriver.ts:266–280  ·  view source on GitHub ↗
(
    entityName: EntityName<T>,
    where: FilterQuery<T>,
    options: FindOptions<T, any, any, any>,
  )

Source from the content-addressed store, hash-verified

264 }
265
266 override async findVirtual<T extends object>(
267 entityName: EntityName<T>,
268 where: FilterQuery<T>,
269 options: FindOptions<T, any, any, any>,
270 ): Promise<EntityData<T>[]> {
271 const meta = this.metadata.find(entityName)!;
272
273 if (meta.expression instanceof Function) {
274 const em = this.createEntityManager();
275 return meta.expression(em, where as T, options) as EntityData<T>[];
276 }
277
278 /* v8 ignore next */
279 return super.findVirtual(entityName, where, options);
280 }
281
282 async *streamVirtual<T extends object>(
283 entityName: EntityName<T>,

Callers 2

findMethod · 0.95
findOneMethod · 0.95

Calls 3

createEntityManagerMethod · 0.95
findMethod · 0.65
findVirtualMethod · 0.65

Tested by

no test coverage detected