Get MongoDB objects between a given range indexes

Course Queries Syllabus Queries 3 years ago

1.63K 1 0 0 0

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 years ago

How can i fetch the mongodb objects from a starting index to an end index. For example I have 100 objects and i want to get these objects first 1 to 10 then 11 to 20 and then 21 to 30. How can I write a mongodb query which returns me the objects 11 to 20. Thanx

My code is

Template.syllabus_design.topics = function () {
    var syllabus = Meteor.syllabi.findOne(Session.get("currentSyllabusId"));
    topics= Meteor.topics.find({subject_id: syllabus.subject_id, level_id: syllabus.level_id})
return topics 

}

0 views
0 shares

No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Similar Forum