petersirka / nosql

NoSQL embedded database for small node.js projects
Other
295 stars 48 forks source link

When filter is defined for view.all, itemSkip and itemTake no longer optional #4

Closed ronaldsuwandi closed 11 years ago

ronaldsuwandi commented 11 years ago

If I define a filter for the view, I must specify itemSkip and itemTake - the following code works

items.view.all('viewname', function(selected, count) {
  console.log(selected, count);         
}, 0,0, function filter(item) {
  return item.position === 'top';
});

However if I simply remove itemSkip and itemTake from the parameter, the filter is no longer executed and it will simply just show all elements in the view

items.view.all('viewname', function(selected, count) {
  console.log(selected, count); // this will print everything
}, function filter(item) {
  return item.position === 'top';
});
petersirka commented 11 years ago

Hi @ronaldsuwandi, I fixed this problem. Please update your module and I will publish new version in few days. Download module code from GitHub, not from NPM.

If you will find a problem, please write me. Thank you.