I wanted to know if there was a way to use QueryDsl's TypeSafe approach to perform a projection on a query in conjunction with Spring Data.
Like for example :
public interface ColorCollectionRepository extends MongoRepository<ColorCollection, String>, QuerydslPredicateExecutor<ColorCollection> {
Optional<ColorCollection> findByCodeIs(String code);
List<ColorCollection> findAll(Predicate predicate);
}
And running a query where I would like to exclude a field named "references"
QColorCollection qColorCollection = QColorCollection.colorCollection;
qColorCollection.code.eq("code");
qColorCollection.exclude("references");
Thanks