How to query with aggregate lookup where foriegn key is in array of document

I have two documents (Party, Ledger) referencing via party_id like below.
Party {
party_id: 1001
party_title: ‘abc’
}

Ledger {
vocno, 1
date: 12-02-2022
transactions: [
{
party_id: 1001
debit;: 1000
credit: null
},
{
party_id: 1002
debit;: null
credit: 1000
}
]
}

I want to query using aggregation framework using $lookup to get results like this.
{
vocno,
date,
transactions: [
{
party_id: 1001,
party_title: ‘abc’,
debit;: 1000,
credit: null
},
{
party_id: 1002,
party_title: ‘xyz’,
debit;: null,
credit: 1000
}
]

how to write query using $lookup

There is nothing special to do.

A normal $lookup with localField:"party_id" and foreignField:"transactions.party_id" should be good.

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
]

I misunderstood your requirements.

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?

Please Formatting code and log snippets in posts and publish you sample documents. Include both parties referred in your sample ledger document.

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.