-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
Description
Hi,
I would like to know if there is an option to set multiple values, like I can get multiple values.
For example:
import dpath.util
simple_json = {"a": [{"1": "b"}, {"1": "c"}]}
extracted_list = dpath.util.values(simple_json,"a/*/1")
print(extracted_list)
# ['b', 'c']
new_list = ["d","e"]
extracted_list = dpath.util.set(simple_json,"a/*/1",new_list)
print(simple_json)
# {"a": [{"1": "d"}, {"1": "e"}]}