Using a variable to pass the return value of a function works but it is not exactly elegant.

Here is an alternative:

        function mongoCmd()
        {
          db=$1
          cmd=$2
          echo $cmd | mongo $db | tail -n 2 | head -n 1
        }

        m=$(mongoCmd orion help)
        echo $m