Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit your views in CouchDB Futon?

Tags:

couchdb

I am using CouchDB Futon to edit the views and shows. But I find it hard to edit the JavaScript code because of converting the newline to "\n". Also, it is hard to do all the escaping work.

What do you use to edit your views?

like image 214
David M. Avatar asked Aug 30 '10 19:08

David M.


People also ask

What are views in CouchDB?

Basically views are JavaScript codes which will be put in a document inside the database that they operate on. This special document is called Design document in CouchDB. Each Design document can implement multiple view. Please consult Official CouchDB Design Documents to learn more about how to write view.

Where does the permanent views are stored in CouchDB?

A permanent view is stored as a special kind of document between the other regular documents. These special kind of documents are called 'design documents'. A permanent view can be executed by performing a GET operation with the name of the view.

How do I add data to CouchDB?

Open the Overview page of the database and select New Document option as shown below. When you select the New Document option, CouchDB creates a new database document, assigning it a new id. You can edit the value of the id and can assign your own value in the form of a string.

How do I access CouchDB?

Creating a Database using Futon To create a database open the http://127.0.0.1:5984/_utils/. You will get an Overview/index page of CouchDB as shown below. In this page, you can see the list of databases in CouchDB, an option button Create Database on the left hand side. Now click on the create database link.


2 Answers

Maybe you want to have a look at the CouchApp framework. It allows you to have your map, reduce, show, list etc. functions in text files you can edit with the editor of your choice. A simple command pushes them to your design documents. It is intended for building CouchApps, but might as well be useful if you only need to edit your views.

  • http://couchapp.org
  • http://github.com/couchapp/couchapp
like image 59
titanoboa Avatar answered Oct 05 '22 13:10

titanoboa


You can edit view code by browsing to it in Futon, and then expanding the source code area. You can then save/undo, etc.

For the other functions, and views too, you can always use LoveSeat.

Cheers.

like image 23
Sam Bisbee Avatar answered Oct 05 '22 13:10

Sam Bisbee