3 ms·
That gets you decently far, especially with small JSON responses. You can't filter with any tree display though, which is what I normally reach to jq for. Being
by amw-zero 10y ago
That gets you decently far, especially with small JSON responses. You can't filter with any tree display though, which is what I normally reach to jq for. Being able to filter an array of objects down to only one property in each object is invaluable to me.
For example, in a JSON payload that has an array of 15 objects, I would like to see all IDs of those objects. The output would be something like [1230, 134, 65, 99]. I like looking at that vs scrolling and collapsing a bunch of objects.
- jordache 10y agowrite a quick lodash method call to filter your collection. given the consistent nature of data collections I almost never have a need to examine the full dataset via some front end debugging tool. trust the data to be consistent or not?
- amw-zero 10y agoDefinitely do whatever you think is easier in your workflow. Not everyone uses lodash, but I know a lot of people that prefer to do mapping / filtering of JSON in an actual programming language. That doesn't make one way better or worse than another. 2 ways of accomplishing the same thing. Not sure what the point about consistency has to do with anything? What if it's an array of consistent, but large objects? I find I need to examine a full page of JSON quite frequently. I.e. there's some bug, and I need to check for any occurrences of null for a specific property.