couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils Breunese <N.Breun...@vpro.nl>
Subject RE: share code between views
Date Sun, 26 Apr 2009 12:19:33 GMT
This was discussed just this week in the thread "The sum function (used in reduce)". I (and
others) recommend using CouchApp to manage your view code and make use of its macro feature
to import the shared code.

Nils Breunese.
________________________________________
Van: Elf [elf2001@gmail.com]
Verzonden: zondag 26 april 2009 12:13
Aan: user@couchdb.apache.org
Onderwerp: share code between views

I have database with documents (yeah, really). Each documents has alot
of data. Depending on this data, document has state. Now state is
counted by a view. I want not to store this state as separate field to
make documents be very dynamic. Also, from time to time (at algorithm
change) I need to modify status calculation function. The problem is I
have several views (about 6-8 now) wich uses the same status
calculation code. Modifying all of them to change 1-2 lines of codes
is painfull.

Is it possible to share code (for example, function) between several views?

Anothe way i thinks about, was to push status calculation function
into query server. But here is another problem - if document is not
changed, but I change status calculation function, old view results
will remains in results of quering my views. But, if I can make mark
documents changed, or cache - obsolete, views will become actual. Is
it possible to make so?


--
----------------
Best regards
Elf
mailto:elf2001@gmail.com

De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik
door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging,
verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde.
De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden
e-mail, noch voor tijdige ontvangst daarvan.

Mime
View raw message