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.
However, one thing the documentation says is this:
Creating a sync function is a more flexible way to map documents to channels. A sync function is a JavaScript function that takes a document body as input and, based on the document content, decides what channels to assign the document to. The sync function cannot reference any external state and must return the same results every time it's called on the same input.
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. Maybe instead of calling it channel on the model, I call it "database_id" or something like that. Then the database_id is used as the channel name on the Sync Gateway.
Perhaps the "database_id" along with a username property? I still need to figure out how authorization and managing user accounts works.
Would something like that work?
Thanks,
Brendan