Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hey, fq author here. Happy to hear it's useful! could you elaborate a bit more how it was less intuitive? fq's query language is jq with some small additions so i wonder if you might mean the decoded structure is more detailed/verbose as it includes all the "low level" details? maybe your looking for the "torepr" function that converts the detailed structure into the "represented" value?


Yes that's exactly what I meant, the MsgPack documents had quite a detailed structure.

torepr didn't quite work for me as I was dealing with objects containing large binary blobs and it was awkward.

fq is a great tool and I shouldn't have suggested this was a problem unique to it! I think this kind of "issue" is inevitable when dealing with so many types of input. And to be honest I struggle hard using jq as well for anything other than very basic paths, due to infrequent usage.


I see, thanks for replying and no worries! yeap some of the "self-describing" formats like msgpack, cbor etc will because of how fq works have to be decoded into something more of a meta-msgpack etc.

About blobs, if you want to change how (possibly large) binaries are represented as JSON you can use the bits_format options, see https://github.com/wader/fq/blob/master/doc/usage.md#options, so fq -o bits_format=md5 torepr ...

I can highly recommend to learn jq, it's what makes fq really useful, and as a bonus you will learn jq in general! :)


Oh that's a great tip, I will try to remember this next time I'm touching the msgpacky parts of my app!


Never seen this tool before but it looks quite handy. Thanks!


hope it can be of use!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: