implemented ability to return instances and not simple dicts for distinct on subdocuments