Open GitHubForTroy opened 5 years ago
Yes, there is. This example replaces all nodes named "isbn" with "0-****-3".
DocumentContext dc = JsonPath.parse("insert your json string here")
dc.put("$..isbn", "0-****-3");
If you'd like to replace only some nodes depending on their value you could use e.g. regular expressions inside the path:
$..[?(@.isbn=~/0-\d{3}-\d{5}-3/)].isbn
@GitHubForTroy @hf-kklein Can you please check my issue..?? https://github.com/json-path/JsonPath/issues/982#issue-2082624079
ex : { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99 }
==> { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-****-3", "price": 8.99 } if i match "isbn" node