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

How to add a sync gateway user to get a doc or list documents from an existing bucket data (travel-sample)

    XMLWordPrintable

Details

    • 1

    Description

      It has been observed that it is not obvious to the beginner that the sync gateway user should be created with admin_channels as '*' to read or list the documents with an existing bucket data like travel-sample.

      In the below document, it would be good to cover the use case snippet to just have access to all documents by adding admin-channels to '*' and then selectively how to restrict the access to certain documents by pointing to the channel creation documents.
      https://docs.couchbase.com/sync-gateway/current/get-started-verify-install.html

      Example:
      % curl -X POST "http://localhost:4985/traveldb/_user/" -H "Accept: application/json" -H "Content-Type: application/json" -d '

      {"name": "test5", "password": "test123", "admin_channels": ["*"]}

      '

      List of docs:
      % curl -utest5:test123 http://localhost:4984/traveldb/_all_docs?limit=20

      Get the existing doc:
      curl -utest5:test123 http://localhost:4984/traveldb/airline_10

      Attachments

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

        Activity

          People

            Ian.bridge Ian Bridge
            jagadesh.munta@couchbase.com Jagadesh Munta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty