CouchDB-simple-queries
CouchDB is a backronym for “cluster of unreliable commodity hardware”. I think it is similar to RAID abbreviation ( redundant array of inexpensive disks)
You can use Fauxton GUI but i love CLI so i will try to note some simple basic queries. I am also trying to learn CouchDB new, so below examples are not crazy, they are ABC J I just focused on SELECT queries for now. If you want to INSERT, you must try curl –X PUT
Feel free to communicate by bulent.yucesoy@gmail.com
[server1]~#export
HOST=http://localhost:5984
[server1]~#curl
-X GET $HOST
{"couchdb":"Welcome","version":"2.1.1","features":["scheduler"],"vendor":{"nssame":"The
Apache Software Foundation"}}
[server1]~#curl
-X GET $HOST/_all_dbs
["_global_changes","_replicator","_users","mychannel_","mychannel_fabcar","mychannel_lscc"]
[server1]~#curl
-X GET $HOST/mychannel_fabcar
{"db_name":"mychannel_fabcar","update_seq":"13-
g1AAAAEzeJzLYWBg4MhgTmHgzcvPy09JdcjLz8gvLskBCjMlMiTJ____PyuRDYeCJAUgmWQPVsOAS40DSE08fjUJIDX1YDXMONTksQBJhgYgBVQ2PyuRCa-6BRB1-
3HbCVF3AKLuPiF1DyDqgO5jygIAkcRjAw","sizes":{"file":62750,"external":2132,"active":3642},"purge_seq":0,"other":
{"data_size":2132},"doc_del_count":0,"doc_count":11,"disk_size":62750,"disk_format_version":6,"data_size":3642,"compact_running":false,"cluster":
{"q":8,"n":1,"w":1,"r":1},"instance_start_time":"0"}
[server1]~#
[server1]~#curl
-X GET $HOST/mychannel_fabcar/_all_docs
{"total_rows":11,"offset":0,"rows":[
{"id":"CAR0","key":"CAR0","value":{"rev":"1-7fc2357cd31c1922a6036eeff1564867"}},
{"id":"CAR1","key":"CAR1","value":{"rev":"1-05fb3e1f07e9c90a04bb712b92a65e78"}},
{"id":"CAR11","key":"CAR11","value":{"rev":"3-94ca5f41d656311ada7b21ba24f6252a"}},
{"id":"CAR2","key":"CAR2","value":{"rev":"1-9cff18fefe7e2656e82fdc1d2a390866"}},
{"id":"CAR3","key":"CAR3","value":{"rev":"1-dfc1b50df4780e0136bd574523c8e067"}},
{"id":"CAR4","key":"CAR4","value":{"rev":"1-da61008ff0f34bd5511eb340db76bd5e"}},
{"id":"CAR5","key":"CAR5","value":{"rev":"1-522158f7734c7e49c78277bd317da6ab"}},
{"id":"CAR6","key":"CAR6","value":{"rev":"1-d55d2d94027e6007906e161c3f395be9"}},
{"id":"CAR7","key":"CAR7","value":{"rev":"1-d3107dcbbf944e12882a43a2ba39e8fc"}},
{"id":"CAR8","key":"CAR8","value":{"rev":"1-424c0fbb07cebf4ca4edfd216f4031ff"}},
{"id":"CAR9","key":"CAR9","value":{"rev":"1-21d08b18ae88c0a8a56ad96519887f59"}}
]}
[server1]~#