======================= Nagare Text File, ==================== ================================================================ ~/Compliance/Invoice/list/ => db.EvolveInvoice.aggregate([{ "$lookup": { "from": "EvolveEINVDoc", "localField": "EvolveEINVDoc_ID", "foreignField": "_id", "as": "EvolveEINVDoc_ID", } }, { $unwind: { path: "$EvolveEINVDoc_ID", preserveNullAndEmptyArrays: true } }, { "$lookup": { "from": "EvolveUnit", "localField": "EvolveUnit_ID", "foreignField": "_id", "as": "EvolveUnit_ID", } }, { $unwind: { path: "$EvolveUnit_ID", preserveNullAndEmptyArrays: true } }, { $addFields : { EvolveInvoice_DateFormated : {$dateFromString: { dateString: "$EvolveInvoice_Date", format: "%d/%m/%Y" } } } }, { $match: { "EvolveInvoiceGSPDetails.EvolveInvoice_IrnNo": { $ne: "" }, } }, { $sort: { _id: -1 } }, { $facet: { result: [], } }, ])