Added skip/limit to memory adapter
This commit is contained in:
parent
ee05ebcca6
commit
e13149edc5
|
@ -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 () {
|
||||
|
|
Loading…
Reference in New Issue