Using this package you can [Get/Create/Update/Delete] your map's nested properties as easy as json.
For example:
document := map[string]interface{}{
"one": map[string]interface{}{
"two": map[string]interface{}{
"three": []int{
1, 2, 3,
},
},
"four": map[string]interface{}{
"five": []int{
11, 22, 33,
},
},
},
}
Get a property
property, err := GetProperty(document, "one.two.three[0]")
fmt.Println(property)
// property => 1
property, err = GetProperty(document, "one.two.three", ".")
fmt.Println(property)
// property => 1, 2, 3
Create
err := CreateProperty(document, "one.three", "third value")
Update
err := UpdateProperty(document, "one.two.three[0]", "updated value")
err := UpdateProperty(document, "one/two/three[4]", []int{1,2,3,4}, "/")
Delete
err := DeleteProperty(document, "one.four")
err := DeleteProperty(document, "one.two.three[3]")