limit + skip

Added filter limit + filter skip for query .all
This commit is contained in:
Muneeb Samuels 2012-10-19 01:27:02 +03:00
parent 52b830de40
commit 03f9c24642
1 changed files with 2 additions and 1 deletions

View File

@ -261,7 +261,8 @@ CradleAdapter.prototype.count = function(model, callback, where) {
CradleAdapter.prototype.models = function(model, filter, callback, func) {
this.client.all(
{include_docs: true},
// maybe there is a better way to do this?
{include_docs:true, limit: filter.limit == null ? 9999999999 : filter.limit, skip: filter.skip == null ? 0 : filter.skip},
errorHandler(callback, function(res, cb) {
var docs = res.map(function(doc) {
return idealize(doc);