تخطَّ إلى المحتوى

Early Materialization (ARCH3056)

هذا المحتوى غير متوفر بلغتك بعد.

Key typescript.orm.early-materialization · Severity warning · Category orm

Pulling a query result into memory (list/array) first and then filtering/ordering/aggregating moves work that belongs in the database into the application. Push that work into the query.

const all = await orderRepo.find();
const active = all.filter(o => o.status === 'active'); // in-memory filter
const active = await orderRepo.find({ where: { status: 'active' } });

Push filtering/ordering/aggregation into the query with where/orderBy/aggregates.