The problem that we faced is that we have to make views manually from the GUI of the couchbase, but it was quite a cumbersome task, so this blog is about how to make views automatically.

In this blog we’ll learn how to create a script of curl commands and just run that script for making views and the views will automatically get created on the couchbase server.

You do not have to make views manually now, just run a script file and it automatically gets created , so that you don’t have to make views manually on staging server and it can easily be made just by running a simple script file.

For creating a design document and views from a script file :

Firstly , you have to make a .ddoc file, the name of file should be same as that of the design document that you want to create.

Then inside that .ddoc file you have to write the json for creating view