Unable to create design document

I’m new in CouchBase. I tried to create a new design document.
This is what I did:
curl -X PUT -u username:password -H “Content-Type: application/json” http://localhost:8092/beer-sample/_design/dev_sample

I got {“error”:“unknown_error”, “reason”:“badarg”}

I’m using version 3.0.3-1716 Enterprise Edition (build-1716).

Can anyone tell me how can I create a new design document?

Thanks,
Sachli

@sachli yes, you should create the design document through our officially supported SDKs. which language are you using?

I’m using nodejs.
Can you show me the reference how to create design document via SDK?
I have tried to search it with no result.
All I’ve found just to create new view, not new design document.

Hi,

if you are using nodejs, take a look at the documentation here: http://docs.couchbase.com/sdk-api/couchbase-node-client-2.0.9/BucketManager.html#insertDesignDocument

You need to use the insterDesignDocument method from BucketManager.

About your REST call you’re missing the design doc payload: http://docs.couchbase.com/admin/admin/REST/rest-ddocs-create.html

But as Michael said, please keep using the SDK directly.

Thank you very much @daschl and @ldoguin for your prompt help. I’ll go through that document.

Hi, Can you please tell me how to create design document on REST API. I have been using coucbase lite. Now i want to access those data on PUBLIC REST API. i tried to created design documents but its useless i’m getting error.

Your suggestions would be appreciable.

Us that what you are looking for by chance @itssrinadh http://developer.couchbase.com/documentation/mobile/1.2/develop/references/couchbase-lite/rest-api/design-document/index.html ?