func (q *Query) SortBy(fields ...string) *Query {
	for i := range fields {
		if fields[i] == Key {
			panic("Cannot sort by Key.")
		}
		found := false
		for k := range q.sort {
			if q.sort[k] == fields[i] {
				found = true
				break
			}
		}
		if !found {
			q.sort = append(q.sort, fields[i])
		}
	}
	return q
}
// SortBy sorts the results by the given fields name
// Multiple fields can be used
SortBy sorts the results by the given fields name
Multiple fields can be used
// SortBy sorts the results by the given fields name // Multiple fields can be used
func (q *Query) SortBy(fields ...string) *Query {
	for i := range fields {
		if fields[i] == Key {
			panic("Cannot sort by Key.")
		}
		found := false
		for k := range q.sort {
			if q.sort[k] == fields[i] {
				found = true
				break
			}
		}
		if !found {
			q.sort = append(q.sort, fields[i])
		}
	}
	return q
}
func ( q * Query ) SortBy ( fields ... string ) * Query { for i := range fields { if fields [ i ] == Key { panic ( " " ) } found := false for k := range q . sort { if q . sort [ k ] == fields [ i ] { found = true break } } if ! found { q . sort = append ( q . sort , fields [ i ] ) } } return q }
SortBy sorts the results by the given fields name
Multiple fields can be used
SortBy sorts the results by the given fields name Multiple fields can be used