Ah, I didn't realize you can call emit more than once in a block. Thanks!

On Sunday, April 20, 2014 9:04:13 PM UTC-7, Jens Alfke wrote:
>
>
> On Apr 20, 2014, at 6:17 PM, Ragu Vijaykumar <[email protected]<javascript:>> 
> 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/a5fedb71-116f-4d7e-8f7a-647721ddaa46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to