SubAccounts

This commit is contained in:
Paolo Arena
2020-05-10 21:07:51 +02:00
parent 7d0538f7ae
commit ae77637d33
17 changed files with 1535 additions and 499 deletions

View File

@@ -118,10 +118,32 @@ function getQueryProj(myfilter) {
{ $match: myfilter },
{
$lookup: {
from: "users",
from: "listaingressos",
localField: "ind_order",
foreignField: "ind_order", // field in the user collection
as: "user"
as: "mylista"
}
},
{
$unwind: "$mylista"
},
{
$lookup: {
from: "users",
as: "user",
let: {username: '$mylista.username' },
pipeline: [
{
$match: {
$expr: {
$and: [
{ $eq: ['$username', '$$username'] },
{ $eq: ['$idapp', myfilter.idapp] },
]
}
}
}
]
}
},
{