Use doc._id, not doc.id.

—Jens 

> On Jul 1, 2015, at 8:56 PM, atom992 <[email protected]> wrote:
> 
> 
> 
> I am using PhoneGap to develop a android app, and I wrote a view like this:
> 
>         db.put(design, {
>             views : {
>                 getIDByKey : {
>                     map : function (doc) {
>                         if(doc.type && doc.key){
>                            emit([doc.key,doc.type],doc.id);
>                         }
>                     }.toString()
>                 }
> 
> 
> but It not works (It shows "null" in the response that [doc.id] should be 
> show), not like the couchbase server's view, It can take (doc,meta) two 
> parameter, How can I emit doc.id in couchbase Lite's view, such as be part of 
> key(emit([doc.type,doc.id],[doc.value]) I want to use doc.type and doc.id to 
> get doc.value)?
> -- 
> 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/94da15b0-b4ae-4894-9491-cd972ead6aec%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/E0B81F13-96BA-4D4E-BD69-8802B5C39312%40mooseyard.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to