my whole sync function like this:
function(doc,oldDoc){
if(doc.type == "type1"){
if(doc.key_id1){
channel('u-' + doc.key_id1);
}
}
if(doc.type == "type2"){
if(doc.key_id){
channel('b-'+doc.key_id);
}
}
}
If I use switch I get right result.
On Tuesday, May 12, 2015 at 4:43:15 AM UTC+8, Jens Alfke wrote:
>
> Weird — is that your sync function *exactly* as present in the config
> file? Because my guess is that there’s a typo in one of the places you put
> “key_id”, even though that isn’t showing up in the code you posted. Because
> it’s clear that the variable key_id in the channel(…) call is undefined.
>
> You can call log(…) in a sync function to log a string to the console.
> That might help you debug this.
>
> —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/531142af-c18a-4ee1-8542-4d3af9d339e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.