deyles-zz / sculejs

SculeJS - data structures for the web
165 stars 24 forks source link

Support for the $skip aggregation operator #6

Closed deyles-zz closed 11 years ago

deyles-zz commented 11 years ago

SculeJS should support the $skip operator using the same implementation rationale as MongoDB - http://docs.mongodb.org/manual/reference/aggregation/skip/

For example, performing a query for all objects there i >= 5, skipping the first 20 would look like:

var scule = require('sculejs');
var collection = scule.factoryCollection('scule+dummy://test');
collection.find({i:{$gte:5}}, {$skip:20}, function(o) {
   o.forEach(function(d) {
      // do something here
   });
});

Estimated effort: 2 days