I am having issues getting the sync_gateway to return any documents. I am not sure if I am missing anything. How do I get the server documents to sync to the gateway? I have read I might have to do this manually but how should this be done? How do I get new documents to sync ongoing.
My config:
{
"interface":":4984",
"adminInterface":":4985",
"log":["HTTP+","CRUD","REST+"],
"databases":{
"lib_development":{
"bucket":"lib_development",
"sync":`function(doc) {channel(doc.channels);}`
}
},
"pretty": true,
"verbose": true
}
This creates these documents on the server
_sync:syncdata
{
"Sync": "function(doc) {channel(doc.channels);}"
}
Ive added a user to the gateway
curl -X PUT localhost:4985/$DB/_user/fgynen --data '{"password":"password","admin_channels":["library"], "name":"fgynen"}'
And this user record gets synced to the "lib_development" bucket on the server.
_sync:user:fgynen
{
"name": "fgynen",
"admin_channels": {
"library": 1
},
"all_channels": {
"library": 1
},
"passwordhash_bcrypt": "JDJhJDEwJHB6Mmo0VFA1dHh0cXBhc3Jha1BiOHVvZWUvQjFteTJueEtHcFBhUVpWNVlVbFFEQnZ4Q2J5",
"roles": []
}
Example server document:
{
"type": "cbase_question",
"section_id": 5,
"name": "question",
"channels": [
"library"
]
}
Getting _all_docs on the gateway
{"rows":[
],
"total_rows":0}