Open ngarg-kr opened 1 year ago
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.
Craig
@tidwall is this possible to write such query?
@ngarg-kr I didn't try it, but I think that if you register a custom modifier to calculate the length, let's say @len, you might be able to get what you're looking for with:
@len
friends.#(first.@len==5)#.last
For a sample payload like this
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?