Problem with Couchbase Lite Design Document Creation on Public REST API


#1

Hi, Im unable to create Design document as like mentioned in this link.

Im getting error like Forbidden. i setup configuration file for user_views to true. as like below mentioned json.

{
	log: [
		"*"
	],
	databases: {
		db: {
			server: "http://myipaddress:8091/",
			bucket: "default",
			unsupported: {
				user_views: {
					enabled: true
				}
			},
			users: {
				GUEST: {
					disabled: false,
					admin_channels: [
						"*"
					]
				}
			}
		}
	}
}

Any one please help me on this.


#2

Couchbase Lite or Sync Gateway? The thread title and documentation link imply Couchbase Lite, but the config file you’re showing is for Sync Gateway.

Also, please show the exact HTTP request you’re sending, and what the response is.


#3

Oh, also — if it’s on Sync Gateway, you need to create the design documents using the Couchbase Server admin tool, because the views are actually run and managed by Couchbase Server itself.


#4

Hi Jens, Sorry for later reply. Here is my request

PUT request http://myserverurl:8092/default/_design/userslist

{
   "views" : {
      "byloc" : {
         "map" : "function (doc, meta) {\n  if (meta.type == \"json\") 
         	{\n    emit(doc.city, doc.sales);\n  } else 
         	{\n    emit([\"blob\"]);\n  }\n}"
      }
   }
}

I followed this link im running above on postman. am i run above only on Couchbase Server API. is there any possibilities with PUBLIC API


#5

So you’re talking to Couchbase Server itself, not Sync Gateway. I don’t know why this would fail. Does your Couchbase Server require authentication, and if so are you supplying the right credentials?

You’d be better off asking in one of the server topic areas, since this question isn’t directly related to Couchbase Mobile.