查找以JSON Path开头的JSON属性名称
问题描述:
是否可以使用JSON Path找到与正则表达式模式(或至少以其开头)匹配的属性名称。在XPath中我可以使用 name()
但是我找不到等效的JSON路径。
Is it possible to find a property name that matches a regex pattern (or at least starts with) using JSON Path. In XPath I can use name()
but I haven't been able to find the JSON Path equivalent.
基本上,我找到所有以 x开头的属性名称 -
。类似 $ .. x - *
。
Basically, I what to find all property names that start with x-
. Something like $..x-*
.
我有兴趣使用任何 javascript包这样做。目前,我正在使用 JSONPath 。
I'll be interested in using any javascript package that does this. Currently, I'm using JSONPath.