On Jul 11, 2014, at 5:02 PM, Mark <[email protected]> wrote:

> But this doesn't work. The [doc objectForKey:@"user"] returns the internal 
> id, not the usermodel. This makes sense if you understand that you are being 
> passed the dictionary of the document properties, but it's a problem for my 
> needs.

Right. A document is not a model, it's a lower-level entity.

> Reading the docs, I shouldn't reach out into the database to look up 
> information about the user.

Yes. You absolutely cannot access external data, including another document, in 
a map function. The index has to be based on nothing but the contents of the 
document being indexed. (This is true of any kind of database.)

I'm not sure what your view is trying to do. It looks like you're emitting 
key/value pairs where the key is the text of the comment, but that doesn't make 
sense as a key. Can you describe what your goal is?

--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/ACC9C6A6-33F1-4D18-BD1E-E92C402824BA%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to