optimizing DB projections
This commit is contained in:
@@ -38,6 +38,15 @@ export const fetchBarcodeDataForPrint = withUser(async (user: AuthenticatedUser,
|
||||
userId, // ensure data belongs to authenticated user
|
||||
"yearMonth.year": year,
|
||||
"yearMonth.month": month
|
||||
}, {
|
||||
// project only necessary fields
|
||||
projection: {
|
||||
name: 1,
|
||||
bills: 1,
|
||||
barcodeImage: 1,
|
||||
hub3aText: 1,
|
||||
payedAmount: 1
|
||||
}
|
||||
})
|
||||
.toArray();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user