gjson icon indicating copy to clipboard operation
gjson copied to clipboard

Retrieving data based on length of the string fields

Open ngarg-kr opened this issue 1 year ago • 1 comments

For a sample payload like this

{
  "name": {"first": "Tom", "last": "Anderson"},
  "age":37,
  "children": ["Sara","Alex","Jack"],
  "fav.movie": "Deer Hunter",
  "friends": [
    {"first": "Dale", "last": "Murphy", "age": 44, "nets": ["ig", "fb", "tw"]},
    {"first": "Roger", "last": "Craig", "age": 68, "nets": ["fb", "tw"]},
    {"first": "Jane", "last": "Murphy", "age": 47, "nets": ["ig", "tw"]}
  ]
}

I need the last name of those friends whose first name is of 5 characters which will be Craig in this case.

@tidwall is this possible to write such query?

ngarg-kr avatar Mar 27 '23 11:03 ngarg-kr