Check_Point
156-521 · Question #163
What does jq '.[0]' do when used on an array of JSON objects?
The correct answer is C. Returns the first object in the array. jq '.[0]' selects the first element of the JSON array, which is useful when only one result is needed or when parsing data like a list of network objects.
Check Point API Fundamentals
Question
What does jq '.[0]' do when used on an array of JSON objects?
Options
- AReturns the UID of the first object
- BReturns the last item
- CReturns the first object in the array
- DDeletes the first entry
How the community answered
(15 responses)- A7% (1)
- B7% (1)
- C87% (13)
Explanation
jq '.[0]' selects the first element of the JSON array, which is useful when only one result is needed or when parsing data like a list of network objects.
Topics
#jq#array indexing#JSON arrays
Community Discussion
No community discussion yet for this question.