> On Jul 9, 2015, at 11:04 PM, Daniel Sonny Agliardi <[email protected]> wrote:
> 
> with this method i get in console all document, so how can i select only 
> documents of a kind and with said flag true?

The view you created will index every document that contains a property named 
“workout”. Querying this view with no extra parameters, as you’re doing, will 
return all of the documents that were indexed.

I’m not exactly sure what you want to do, but if you only want to index the 
documents where the “workout” property has a value of true, then change the 
line in the map block to
        if ([doc[@"workout”] isEqual: @YES])

Or if you still want to index all docs with the “workout” property, then leave 
the map function alone but specify what key value you’re querying for:
        query.startKey = query.endKey = @YES;

> In particularly i didn't found a lot of documentation on map block, is there 
> the place where i have to place the conditions?

http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/view/index.html#mapfunctions
 
<http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/view/index.html#mapfunctions>
http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/query/index.html
 
<http://developer.couchbase.com/mobile/develop/guides/couchbase-lite/native-api/query/index.html>

—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/B5095141-E8D3-4265-8F3C-CED10835E564%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to