Hi.

We have currently 2 channels enabled for PULL on iOS application: 
"pmsync_todos" & "pmsync_USER" where USER is the currently logged in user.

We need to deploy certain documents for all users on "pmsync_todos" 
channel, and other documents on a per user basis on each "pmsync_USER" 
channel.

Trying to understand the sync function, how could i authorize 
"pmsync_todosl" channel for all users?

This is my sync function:

function(doc) {

        var coincide;

        if(doc.pmsync_channels){

                channel(doc.pmsync_channels);

                for(var i = 0; i < doc.pmsync_channels.length; i++){

                        if(doc.pmsync_usuarios)

                                for(var j = 0; j < 
doc.pmsync_usuarios.lenght; j++)

                                        access(doc.pmsync_channels[i]
,doc.pmsync_usuarios[j]);

                        if(doc.pmsync_usuario)

                                access(doc.pmsync_channels[i], 
doc.pmsync_usuario);

                }

        }

}

My current approach for enabling access to all users for channel is to 
create a document for each user, using the "pmsync_todos" channel.

{
        "pmsync_channels”:[“pmsync-todos"],
        "pmsync_usuario”:”pmsync-rafael"
}


Should this document enable the channel for my users? or how should be it?

-- 
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 mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/644fdbb0-0249-4628-add0-f0a2794a1d7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to