On Apr 20, 2014, at 6:17 PM, Ragu Vijaykumar <[email protected]> wrote:
> Document2 {
> tags: [tagA, tagC]
> }
>
> The user types in a search term, and I want to return all documents who
> contain the search term as a tag. So if the user types in "tagA", I would be
> able to get back Document1 and Document2, but if they typed "tagB", it would
> only return Document1.
I forget which platform you're using, so I'll write it in pseudo-JavaScript:
function(doc) {
for (tag in doc.tags)
emit(tag, null);
}
Then just query with startKey = endKey = the desired tag.
--Jens
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/6049ACB9-8B3F-4DAD-9331-903FEC2EE00B%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.