> On Feb 17, 2015, at 11:42 PM, Horatiu Potra <[email protected]> 
> wrote:
> 
> My CBLModel object has a property string named url. I want to get one single 
> document based on a certain url.

Make a view whose map function checks that the doc is of the desired type, then 
emits the url property as the key: emit(doc[@“url”], nil)
Create a query on that view.
Set the startKey and endKey properties to the URL string you’re looking for.

In general, a view’s map function will check that the doc matches the criteria, 
then emit the thing you’re searching for as the key. Then you query for the 
range of keys you want.

—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/84C0952C-1F23-4741-B03F-859CC234A7DA%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to