PouchDB views going forward with development of pouch-find

615 views Asked by At

First, I'm a huge fan of couch/pouchdb. However I'm in a bit confused about the project going forward. First, I was very happy when I discovered views, specifically the ability to merge various related documents. My understanding was really helped after reading this document.

Now, I'm a bit concerned about the state of pouchdb views going forward as the pouchdb website says that query (which focused on map/reduce and views) is going away in favour of pouchdb-find. I like find() a lot, however it seems to be great at basic things like secondary indexes and queries based on keys with lt, gr, eq, etc operators. But it doesn't seem to have much in the way of aggregate views.

So, time to turn back to the community for guidance :p I think putting together aggregate views of related docs is very powerful and a cornerstone of couchdb itself (besides the awesome power of sync/replication of course).

Is that going to be built into pouchdb-find? If I need that functionality, how should I include it now and going forward?

1

There are 1 answers

0
nlawson On

PouchDB contributor here, so hopefully I can clear up some of the confusion. :)

  1. Map/reduce is not going anywhere. It's just going to be optional in the future. You can still use the API exactly as written.

  2. pouchdb-find (based on Cloudant Query Language, aka Couch 2.0 "Mango" queries) is designed to replace map/reduce for simpler queries. A lot of newbie programmers get confused by the map/reduce API, because it's usually too complicated for what they want.

  3. Map/reduce's "join" feature is actually not doing anything that magical; it just does an extra get() request to get the joined document. You could do the same thing in your own code, and it would have roughly the same performance characteristics.

So basically in the future you will have the ability to use either pouchdb-find or map/reduce, or even both of them. In fact, that's already the case, since pouchdb-find is available as a beta plugin. :)