I'm using hood.ie for a web app I'm making. I like the simplicity of it however there's something I'm not too sure about.
When retrieving data from the couchDB there is a method: findAll
- which as an example looks like:
hoodie.store.findAll('todo')
.done(function(allTodos) {
//do something with allTodos
})
What I was wondering/don't really like is the fact that I'm getting all the items of type todo
then filtering down once I have e.g. todo with todays date.
Instead of getting all of them, is it possible to just get ones I actually want.
I know there is a find method but that requires an id which i won't have.
Or do i simply not need to worry about this - is the call to get all data not that expensive (if i had 1000+ records I feel it may be).
Any guidance would be appreciated.
Thanks.
You don't need to worry about it.
Hoodie stores all data in your browser, from where it also retrieves the data, it does not send any requests to CouchDB in the background when you call hoodie.store.findAll('todo')
In future, this particular call will become more efficient as Hoodie will use indexing by object types, but unless you have thousands of objects per user, you shouldn't even see the the difference