curl -X PUT --noproxy localhost http://localhost:5984/ex01Register data
curl -X PUT --noproxy localhost http://localhost:5984/ex01/cat -d@cat.jsonRegister a program
curl -X PUT --noproxy localhost http://localhost:5984/ex01/biking -d@biking.json
curl -X PUT --noproxy localhost http://localhost:5984/ex01/hello -d@hello.json
curl -X PUT --noproxy 127.0.0.1 http://127.0.0.1:5984/ex01/_design/ex01 --data-binary @ex01.jsonExecute the program
curl --noproxy 127.0.0.1 http://127.0.0.1:5984/ex01/_design/ex01/_view/fooRegister another program
{"total_rows":3,"offset":0,"rows":[ {"id":"hello","key":"2009/01/15 15:52:20","value":"Hello World"}, {"id":"biking","key":"2009/01/30 18:04:11","value":"Biking"}, {"id":"cat","key":"2009/02/17 21:13:39","value":"Bought a Cat"} ]}
curl -X PUT --noproxy 127.0.0.1 http://127.0.0.1:5984/ex01/_design/ex02 --data-binary @ex02.jsonExecute the program
curl --noproxy 127.0.0.1 http://127.0.0.1:5984/ex01/_design/ex02/_view/foo
{"total_rows":3,"offset":0,"rows":[ {"id":"biking","key":"Biking","value":"My biggest hobby is mountainbiking. The other day..."}, {"id":"cat","key":"Bought a Cat","value":"I went to the the pet store earlier and brought home a little kitty..."}, {"id":"hello","key":"Hello World","value":"Well hello and welcome to my new blog..."} ]}
couchapp generate helloworldAccess
cd helloworld
couchapp generate show hello
cd shows/
vi hello.js
cd ..
export http_proxy=""
couchapp push testdb
http://127.0.0.1:5984/testdb/_design/helloworld/_show/hellohello3.js
function(doc, req) { var str_out = "*** Hello World! ***<br />"; str_out += "*** Good Afternoon ***<br />"; str_out += req.query.who + "<br />>; return str_out; }http://127.0.0.1:5984/testdb/_design/helloworld/_show/hello3?who=Taro
_attachments/hello.html
http://localhost:5984/testdb/_design/helloworld/hello.html
BASE="http://localhost:5984/example03"
#
curl -X DELETE --noproxy localhost $BASE
curl -X PUT --noproxy localhost $BASE
#
curl -X PUT --noproxy localhost $BASE"/a01" -d@a01.json
curl -X PUT --noproxy localhost $BASE"/a02" -d@a02.json
curl -X PUT --noproxy localhost $BASE"/a03" -d@a03.json
curl -X PUT --noproxy localhost $BASE"/a04" -d@a04.json
curl -X PUT --noproxy localhost $BASE"/a05" -d@a05.json
#
couchapp generate myapp
cd myapp
couchapp generate view ex01
map.jshttp://127.0.0.1:5984/example03/_design/myapp/_view/ex01
reduce.js
{"rows":[ {"key":null,"value":13300} ]}
views/ex01/map.jshttp://127.0.0.1:5984/testdb/_design/myapp/_list/list01/ex01lists/list01.js
http://127.0.0.1:5984/librivox/_design/myapp/_view/ex02?key="Japanese"
http://127.0.0.1:5984/librivox/_design/myapp/_view/ex02?key="Polish"
Nov/26/2013 AM 08:15