jugglingdb/nano-adapter — pull request #14 by ierceg (2014-01-25 12:16:39+00:00)
Title: Fixed filtering in all

This is a major patch. I have added automatic generation of CouchDb design documents for all models that have indexed properties. For all such models a separate design document is created and for each indexed property a separate view is created with key being the values of the property.

For example if we had a `User` model with indexed `username` property:

```javascript
var User = describe('User', function () {
property('username', String, { index: true });
....
});
```

This would then automatically generate `_design/nano-User` design document with `by_username` view who's `map` is defined as:

function(doc) { if (doc.model === 'User') return emit(doc.username, null); }

These views are then used in `Adapter.all()` for indexed search if any indexed property is in the `where` param.

I've also added `skip` (read from `offset`) and `limit` to nano parameters. `Model.iterate()` was falling into infinite loop due to the lack of these params.