Clients uses this.db.drug({inventory:true})
Server uses this.drug.list.inventory()
This will be easier once we migrate to CouchDB 2.0 and have Mango Indexes on the server as well. Then our code can just check if there is a view and run it or if there is no matching view use Mango Indexes instead.
Ideally, we could even make this code fully isomorphic so pouch.js (would need to be renamed) would be run as our database API on both the client and server.
Clients uses
this.db.drug({inventory:true})
Server usesthis.drug.list.inventory()
This will be easier once we migrate to CouchDB 2.0 and have Mango Indexes on the server as well. Then our code can just check if there is a view and run it or if there is no matching view use Mango Indexes instead.
Ideally, we could even make this code fully isomorphic so
pouch.js
(would need to be renamed) would be run as our database API on both the client and server.