Details
-
Task
-
Resolution: Unresolved
-
Major
-
None
-
3.1.x
-
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:
- https://docs.couchbase.com/sync-gateway/current/scopes-and-collections-config.html
- https://docs.couchbase.com/sync-gateway/current/rest-api-admin.html#/Database_Management/put_db_
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
- is subtask of
-
DOC-11259 Improve 'new in 3.1' content
- Resolved
1.
|
fix format | Closed | Francis Roberts |