Group by a field and get the first document

SELECT t.group_id, MIN([t.date,t])[1]
FROM default AS t WHERE …
GROUP BY t.group_id;

Explanation is available at Select non-group by fields using sql query