length
length(null)
$ echo '{ "fruits" : ["apple" , "banana" , "cherry"], "vegetables": ["carrot", "broccoli", "spinach", "couliflower"] }' | jq '.fruits | length' 3
$ echo '{ "fruits" : ["apple" , "banana" , "cherry"], "vegetables": ["carrot", "broccoli", "spinach", "couliflower"] }' | jq '.fruits[1] | length' 6
$ echo '{ "fruits" : ["apple" , "banana" , "cherry"], "vegetables": ["carrot", "broccoli", "spinach", "couliflower"] }' | jq length 2
Index