Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-11241

Only one scope per database is supported

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Major
    • None
    • 3.1.x
    • sync-gateway
    • None
    • 0

    Description

      Only one scope per database is supported in Sync Gateway as you can see below:

      # curl -X PUT "http://localhost:4985/my-bucket/" -H "accept: */*" -H "Content-Type: application/json" -d "{\"bucket\":\"my-bucket\",\"scopes\":{\"new-scope\":{\"collections\":{\"new-scope-collection\":{\"sync\":\"function (doc, oldDoc) { if (doc._deleted && doc._deleted === true) { requireRole(\\\"admin\\\"); } else { requireRole(\\\"admin\\\"); channel(doc.channels); } }\"}}},\"third-scope\":{\"collections\":{\"third-scope-collection\":{\"sync\":\"function (doc, oldDoc) { if (doc._deleted && doc._deleted === true) { requireRole(\\\"admin\\\"); } else { requireRole(\\\"admin\\\"); channel(doc.channels); } }\"}}}},\"enable_shared_bucket_access\":true,\"import_docs\":true,\"num_index_replicas\":0,\"revs_Limit\":20,\"rev_cache_size\":10000,\"cache\":{\"channel_cache_max_length\":2000,\"channel_cache_min_length\":2000}}" -u sync_gateway:password
      {"error":"Bad Request","reason":"1 errors:\nonly one named scope is supported, but had 2 (map[new-scope:{map[new-scope-collection:{0xc004d500e0 \u003cnil\u003e}]} third-scope:{map[third-scope-collection:{0xc004d50120 \u003cnil\u003e}]}])"}
      

      However, this limitation seems to not have been mentioned in the documentations here:

      We should mention this limitation in these aforementioned documentations. The anticipated use-cases are one database per scope, and many collections, which allows users to be shared across the collections.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Francis.roberts Francis Roberts
              yuvraj.kanwar Yuvraj Kanwar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty