Problem while creating design documentation

/////////////////////

curl -X POST -H “Content-Type: application/json” http://Administrator:123456@127.0.0.1:8092/EmployeeBucket/_design/dev_field -d @byfield.ddoc

//////////////
this was my error

Warning: Couldn’t read data from file “byfield.ddoc”, this makes an empty
Warning: POST.
{“error”:“not_found”,“reason”:“missing”}

/////////
please help me to solve this ??

@boby, {“error”:“not_found”,“reason”:“missing”}
This error is means bucket is not present. Also for creating a view it should be PUT request not POST. Post is for internal settings.

And also looking at your warning it looks like byfield.ddoc is empty or not readable. The file should contain view definition
example:
{“views”:{“test”:{“map”:“function (doc, meta) {\n {\n emit(meta.id, meta.rev);\n } \n}”}}}

1 Like