CouchDB Create View
There are two employees in our “employees” database.
Let’s suppose employee1 and employee2:
Now, Open Fauxton and go to all documents where you see a block named New View.
Click on new view and fill the required fields:
View is created now. You can verify it and get view result by follow the following commands:
Create a file as “app.js”, having the following code:
Execute the following code:
Open the local browser: localhost:3000
List Databases
Create a folder “view” and then create a file “index.ejs” within it, having the following code:
Now change in the “app.js” file:
Get View Result
Click on all and then click on API URL to copy the url.
Now go to app.js and change the code with the following:
Now start server and you will see the following result:
To see the documents details
Edit “app.js” with the following code:
Output: