4 ms·
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
by wwader 2y ago
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?
- ranger_danger 2y agoNever seen this tool before but it looks quite handy. Thanks!
- wwader 2y agohope it can be of use!
- crabmusket 2y agoYes 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.
- wwader 2y agoI 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 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! :)
- crabmusket 2y agoOh that's a great tip, I will try to remember this next time I'm touching the msgpacky parts of my app!