'How to select jq items where length of key value exceeds a number

I have this JSON input to JQjq

{
  "names": [{
    "name": "John Smith"
  },{
    "name": "Jane Doe"
  },{
    "name": "Jackson Longfellow"
  }]
}

I'd like to use jq to select all the items where the length of the name is > 10 characters. This means the output would be:

{
  "names": [{
    "name": "Jackson Longfellow"
  }]
}

The length filter only seems to count items in an array. Is there some other built-in filter to use for this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source