Hello,

I'm trying to see if it is possible to tell mongoDB to restrict the number of entries of an embedded attribute of array of documents. For example here is my layout:

public class Student {
public List<Course> courses;
}

public class Course {
public String name;
}

How can I tell mongoDB (via mongoTemplate or repositories) to retrieve up to 3 Student's courses ? This is mainly applicable for applications that have tons of documents in the embedded array attribute and only want some of them for performance reasons.

Thanks!

Carlos