I would like to run a query in meteor and limit the number of field returned to only 5. Here is my code :
var courses = Courses.find(
{ day_of_week : {$in: day_selector},
price : {$gt : price_min, $lt : price_max},
starts : {$gt : schedule_min},
ends : {$lt : schedule_max}},
{limit : 10});
console.log(courses);
return courses;
However when I do this, I get all the courses that fit the selector in the console log and not only 10 of those. In the template everything is fine and only 10 courses are displayed.
I looked at this question : Limit number of results in Meteor on the server side?
but it did not help as I am not using specifics _id fields for my courses, I am using specific _id fields but for other collections though.