Reputation: 730
Lets say I have an object in a table called alerts like
{ id:"1"
history:[ {
date:"some date"
hid:"1234"
},
{
date:"some date"
hid:"1234"
}
]
}
{ id:"2"
history:[ {
date:"some other date"
hid:"1235"
},
{
date:"some date"
hid:"1234"
}
]
}
I want an array of just the history objects from all alerts. If I use pluck such as
r.db("irrelevant").table("alerts").pluck("history")
I end up with the whole structure with brackets just no id. like
{
history:[{hid:123,date:"some date"}{hid:123,date:"some date"}]
},
{
history:[{hid:123,date:"some date"}{hid:123,date:"some date"}]
}
When what I want is
[{hid:123,date:"some date"},{hid:123,date:"some date"},{hid:123,date:"some date"},{hid:123,date:"some date"}]
I'm specifically doing this in go but if I can find a RethinkDB javascript query I could probably translate it into go
Upvotes: 0
Views: 78