Throwing "grep -v null" on the end of the command is easy enough, but in many (most?) situations where i'm doing a query on a field name, I don't want records where the query would result in a non-match on the record.
jq 'foo | select(. == null | not)'
should do the trick
Hmm, it seems like it would be simpler to use a general command line option for a wider, more common use case of not wanting any nulls in output.
Alternately:
jq '.foo // empty
Most helpful comment
Alternately:
jq '.foo // empty