On Fri, Mar 27, 2015 at 9:03 AM, Luca Morandini <lmorand...@ieee.org> wrote:
>
> Hope this helps.
>

  Thinking about every example at this point is helpful, eve if it doesn't
solve my immediate problem.  Thanks everyone for the replies.

  I'm currently thinking of combining two views together to solve different
parts of the problem: One that will give me a list of Item IDs that have
changed recently, and then I can pass that array to the other view with a
keys= array.  Not ideal, but seems to work pretty fast.

Note: I can better document my specific data/etc if people are curious, but
trying to avoid flooding the list with that level of detail.

Possibly the closest analogy would be to say that I have "items" which have
increasing version numbers and I have "stores", and any given item can be
in any store.   I have an Item_store document type which has details about
a specific item and its version in a store.

I have a _view which  has a map that emits (item, [item.revision, store]) ,
and a reduce that finds the largest revision, and then returns an array of
all the stores that have the largest revision.

I then have a _list which iterates through all the keys (one per unique
item) and skips the ones for a store I gave it (IE: I'm trying to find all
the items which are in some other store, but not this one).  In most cases
every store already has the latest revision of every item, so I'm looking
for a rare scenario.

I tried having a per-store view, but since every key would still exist (and
most would just be NULL meaning that the store already had the latest
item), there was no saved time over having a generic view that would then
have a _list that would filter.


-- 
System Administration and software developer,
Canadiana.org   http://www.canadiana.ca

Reply via email to