I working on easy access to dynamoDB and I can't find out how to get object according to some props in own slice. What I need is a right expression.
I have this model:
type aaa struct {
Aa string `json:"aaa"`
Ac []bbb `json:"aac"`
}
type bbb struct {
Ba string `json:"bba"`
}
with this data
a := &aaa{
Aa: "Aa",
Ac: []bbb{
{
Ba: "foo1",
},
},
}
for me is working expression like this
expression.Name("aac[0].bba").Equal(expression.Value("foo1"))
but i dont know index. So I was trying
expression.Name("aac.bba").Equal(expression.Value("foo1"))
but this is not working. I also trying contain
expression.Name("aac.bba").Contains("foo1")
but this was working only on scalar types. Any Idea how get the object if i don't know index? Thanks