User and documents are not assigned to any channel


For each user (username and password) i have a document like this:

  "_sync": {
    "rev": "1-6851cb37477b9077081cdf869a23c255",
    "sequence": 3,
    "recent_sequences": [
    "history": {
      "revs": [
      "parents": [
      "channels": [
    "time_saved": "2016-06-20T16:10:47.5939745+02:00"
  "courses": [
  "name": "loris",
  "type": "STUDENT"

The user must be able to access to this document. So my sync function is like this:

	if(doc.type == "STUDENT") {

I created the user “loris”, BUT:

curl http://localhost:4985/university-notes/_user/loris

Note: i created the document before writing the sync_function. If i’ve understood correctly, the sync_function is called only when a document is created/deleted/modified. So probably i have to delete this document and recreate it.



You can run a _resync, which will pass all documents through the sync function again.

If you are using SG 1.2 or later, take the DB offline first:

$ curl -X POST http://localhost:4985/university-notes/_offline

For all versions of SG:

$ curl -X POST http://localhost:4985/university-notes/_resync

If you are using SG 1.2 or later, take the DB online again:

$ curl -X POST http://localhost:4985/university-notes/_online

User lorus should now have access to the “lorus” channel


This is… GOLD! Thank you!