Skip to content

JQ Expression in JSON, Int Value #779

Answered by ricardozanini
k-jay-c asked this question in Q&A
Discussion options

You must be logged in to vote

@k-jay-c, you can convert your data into numbers:

.person.age|tonumber

That doesn't invalidate @cdavernas answer, though. It would be best to validate your data using the correct types before processing. But sometimes, I understand it can be a trick, or you don't have control over it. In those cases, use the jq conversion functions.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cdavernas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants