I'm not talking about how to sort result
. That I know!
It's one of the field in result
that I want sorted in a specific order.
So let say we have a result := []A{}
returned by a mgo query:
type A struct {
I string
II []B
}
type B struct {
X string
XX int
}
In that result
, I want each result[i].II
sorted by B.XX
What I'm asking is can I get this kind of sort done by mgo or I'll have to loop on result
and sort the A.II
Slice my self ?
There is a way to do it with the aggregation engine.