Added skip/limit to memory adapter

This commit is contained in:
Anatoliy Chakkaev 2013-04-19 00:33:57 +04:00 committed by Raymond Feng
parent ee05ebcca6
commit e13149edc5
1 changed files with 5 additions and 0 deletions

View File

@ -135,6 +135,11 @@ Memory.prototype.all = function all(model, filter, callback) {
nodes = nodes ? nodes.filter(applyFilter(filter)) : nodes;
}
// limit/skip
filter.skip = filter.skip || 0;
filter.limit = filter.limit || nodes.length;
nodes = nodes.slice(filter.skip, filter.skip + filter.limit);
}
process.nextTick(function () {