Scontistica- Parte 1

This commit is contained in:
Surya Paolo
2023-12-16 00:51:03 +01:00
parent 1ca72118f1
commit ab3a31d4fb
7 changed files with 127 additions and 4 deletions

View File

@@ -157,6 +157,20 @@ module.exports.findAllIdApp = async function (idapp) {
as: 'provider'
}
},
{
$lookup: {
from: 'scontisticas',
localField: 'idScontisticas',
foreignField: '_id',
as: 'scontistica'
}
},
{
$unwind: {
path: '$scontistica',
preserveNullAndEmptyArrays: true,
},
},
{ $unwind: '$product' },
{ $unwind: '$producer' },
{ $unwind: '$provider' },
@@ -244,6 +258,20 @@ module.exports.getTotalOrderById = async function (id) {
as: 'provider'
}
},
{
$lookup: {
from: 'scontisticas',
localField: 'idScontisticas',
foreignField: '_id',
as: 'scontistica'
}
},
{
$unwind: {
path: '$scontistica',
preserveNullAndEmptyArrays: true,
},
},
{ $unwind: '$product' },
{ $unwind: '$producer' },
{ $unwind: '$storehouse' },