Thanks Jens.  That gave me the answer (in a round about way).

I entered this at the command line

curl -X PUT 'http://localhost:4985/sync_gateway/_user/carrjd12' --data 
'{"admin_channels":["android123"]}'

then started listening in another window on port 4984 via: 

 curl 
'http://carrjd12:fred11@localhost:4984/sync_gateway/_changes?feed=continuous&style=all_docs&since=0&heartbeat=10000'

and then posted this:

curl -v -X POST 'http://carrjd12:fred11@localhost:4984/sync_gateway/' -d 
'{"channels":["android123"], 
"Money":"None"}' -H "Content-Type: application/json"

And the window listening for changes displayed the added document.  Awesome!

But I'd much rather have followed your suggestion to

* Edit the config file to give the user accounts access to the "*" channel, 
> so they can see all docs
>

Unfortunately, in my searching of the docs (and my ignorance) I couldn't 
figure out the syntax/command that I needed to add to the config file (I'm 
assuming the sync_gateway.json config file) to make this happen. What would 
that be?


On Sunday, January 25, 2015 at 4:46:39 PM UTC-6, Jens Alfke wrote:
>
>
> On Jan 24, 2015, at 6:40 PM, John Carr <[email protected] <javascript:>> 
> wrote:
>
> I'm a newbie to the entire CouchBase suite.  I've set up CouchBase, 
> Sync_Gateway and CouchBase-Lite seemingly successfully.  I can get the 
> mobile device to push and pull doc changes (via SG) just fine BUT only if I 
> use SG's Admin port (4985).  If I use the REST port (4984) I get nothing.
>
>
> This is a fairly common getting-started problem. What's probably happening 
> is that the documents you put in the database are not being assigned to any 
> channels that are accessible by the user account doing the pulling. 
> Possible solutions:
>
> * Edit the config file to give the user accounts access to the "*" 
> channel, so they can see all docs.
> * Enable "admin party" mode by enabling the "GUEST" account and giving it 
> access to "*"; then you don't have to worry about logins at all.
> * If you're using the default sync function, add a "channel" property to 
> every doc, then in the config file give the user accounts access to the 
> channels the docs are in.
>
> Hope this makes sense; feel free to ask for clarification if the docs 
> aren't helping.
>
> (And I'm wondering if we shouldn't change the default settings in SG so 
> new users don't hit this issue. Maybe have it default to admin-party?)
>
> —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/61403201-2d67-4f06-ad84-018da148de5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to