i know this question has been asked many times in this forum, but none of them give clear cut answer to the questions. I tried the snippet mentioned in this answer: Common useful JavaScript snippets for geth ; But, it gives me the reply as "undefined" when run in the node.

Can someone please guide me on how i can query the blockchain to get incoming transactions to an address?