Query to compare two fields within a doc?

Hi,
Can I compare two fields in a doc and show all results?

eg;
show all docs where field_1 == field_2

Any ideas?

you mean the value of two fields? if so, you can use filter with a script

doc[field_1].value == doc[field_2].value

hth

jason