incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Bender <codeh...@gmail.com>
Subject Re: My first few days of using couchdb
Date Sun, 25 Jul 2010 17:32:18 GMT
Robin,
 Why don't you have a document for each tag? Your tag document name could be
"tag_TAG". Each of these tag documents would contain an array of UUIDs or
document names that it tags. By making your tag a first class document you
could even tag tags.

 For finding documents tagged with N tags you could download the N tags and
do an intersect or whatever operation you wanted.

-Dave

On Sun, Jul 25, 2010 at 1:18 PM, Joe Bloggs <helpmecouch@yahoo.co.uk> wrote:

> I have been impressed with couchdb so far but I have now hit the first
> problem
> that I cannot see how to resolve easily.
>
> I have a few test documents with a photo attached to each. I want to tag
> these
> photos so I have a field called tags. This tag field may contain 1 or many
> tags.
>
> For example:-
>
> [ "holiday","camping"]
> or
> ["holiday","skiing"]
>
> I can easily create a view that allows me to search the tags with
> ?key="holiday"
> however I cannot work out how to select photos which contains both tag1 and
> tag2.
>
> Any guidance would be appreciated.
>
> Regards
>
> Robin
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message