0

我有这个用青蛙 AQL api 搜索的代码:

   items.find({"name":{"$match":"abab-2.0.3.json"}})

它作为回应回来

{ "results": [ { "repo": "npm-remote-cache", "path": ".npm/abab", "name": "abab-2.0.3.json", "type": "file", "size": 1124, "created": "2020-05-07T21:58:12.633Z", "created_by": "_system_", "modified": "2020-05-07T21:58:12.604Z", "modified_by": "_system_", "updated": "2020-05-07T21:58:12.633Z" } ], "range": { "start_pos": 0, "end_pos": 1, "total": 1 } }

但我只需要“总”字段。有没有办法只得到那个字段?

4

1 回答 1

0

您可以使用jq实现此目的:

cat response | jq .range.total
于 2020-05-26T16:21:53.123 回答