Greetings, I have a problem and I do not know how to consult the elements of a document that has an arrangement and show them in Jade.
Recibo.aggregate(
{"$match":{"nombre":{"$in":req.body.listNombrePTC},"fecha":{"$gte": lastWeekDay, "$lte": today }}},
{"$group":{"_id": "$nombre", "recibos":{"$push": "$$ROOT"}}},function(error,docs){
if(error) {throw error}
console.log( JSON.stringify( docs, undefined, 2 ) );
res.render("comprobacionGastos/listaSemanal",{listaRecibos: docs})
}
)
When that query is executed, it returns documents to me with an array each.
So, my problem is, basically, I do not know how to check those fixes in Jade to show them.