couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elf <elf2...@gmail.com>
Subject share code between views
Date Sun, 26 Apr 2009 10:13:14 GMT
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

Mime
View raw message