4 ms·
I feel like `fq` has a query path language that's kind of generic across lots of file types. It can be fairly verbose for that reason. I was using it to debug M
by crabmusket 2y ago
I feel like `fq` has a query path language that's kind of generic across lots of file types. It can be fairly verbose for that reason. I was using it to debug MsgPack documents and it was a lot less intuitive than just using some dotted string paths with `jq`.
https://github.com/wader/fq/ https://github.com/wader/fq/
- wwader 2y agoHey, 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!