But I want results like this
vocno,
date,
transactions: [
{
party_id: 1001,
party_title: ‘abc’,
debit;: 1000,
credit: null
},
it gives result in separate array like this
vocno,
date,
transactions: [
{
party_id: 1001,
debit;: 1000,
credit: null
},
parties: [
party_title: 'abc
]
You do not want to find the transactions of a party. You want to fill the transactions array with the field party_title from the party collection? Right?
Also publish what you have tried and indicate how it fails so that we do not waste time and propose, like I just did, a solution that does not match your requirements.