如何獲取mongodb對象從開始索引到結束索引。例如,我有100個對象,我想先獲得這些對象1到10,然後11到20,然後21到30.我怎樣才能寫一個mongodb查詢返回對象11到20. Thanx獲取給定範圍內的MongoDB對象索引
我的代碼是
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
}
感謝名單Richsilv,其做工精細 –