On Nov 5, 2015, at 9:01 PM, Brendan Duddridge
<[email protected]<mailto:[email protected]>> wrote:
I was confused because the channels documentation mentions setting the channels
property on the document itself. I didn't know this had to be done on the
gateway.
Thats referring to the default sync function that you get if you don’t specify
any in the SG config. It operates by just looking at a “channels” property in
the document and assigning the doc to those channels. This function literally
just consists of
function(doc) { channel(doc.channels); }
So yeah, one very simple way of assigning channels is by having a property in
the document that explicitly lists the channels to assign the document to.
So that leads me to believe that maybe I do need to set a property on my model
object that can then be used to assign the document to the channel on the Sync
Gateway.
In a sense, the document has to contain the information on what channels to
assign it to, because the sync function isn’t allowed to consult any external
state, just the document.
—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/D78F5B07-A9A0-4142-A600-7F6AB94D3C04%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.