Database

db={"invoices":[{"customer_id":"10","amount":15795,"status":"pending"},{"customer_id":"20","amount":20348,"status":"paid"}],"customers":[{"id":"10","name":"Delba de Oliveira"},{"id":"20","name":"Lee Robinson"}]}

Query

db.invoices.aggregate([{$lookup:{from:"customers",localField:"customer_id",foreignField:"id",as:"customer"}},{$addFields:{amountAsString:{$toString:"$amount"}}},{$match:{$or:[{"customer.id":{$regex:"1579",$options:"i"}},{"customer.name":{$regex:"1579",$options:"i"}},{amountAsString:{$regex:"1579",$options:"i"}},{status:{$regex:"1579",$options:"i"}}]}},{$unwind:"$customer"},{$project:{customer_id:1,amount:1,status:1,name:"$customer.name"}},{$sort:{amount:-1}}])

Result