Query in client script ERPNext


Please Can I find anyone may help me in my problem

I want to retrieve [ exchange_rate] field from Exchange Currency doctype
The output field in the Journal Entry Account doctype ( which is child in Journal Entry doctype)

I want to do this query in client script
and retrieve the output into variable or field :
select exchange_rate from exchange_currency where journal_entry.currency=exchange_currency.from_currency and journal_ entry_ account= exchange_currency.to_currency