顯示具有 couchdb 標籤的文章。 顯示所有文章
顯示具有 couchdb 標籤的文章。 顯示所有文章

2011年12月8日 星期四

[Fixed] 使用CouchDB遇到"Document update conflict"

首先,先取得CouchDB的UUID
>curl -X GET http://127.0.0.1:5984/_uuids
{"uuids":["0bb149459127c0ee3a7d047d760010eb"]}

在要寫入CouchDB的資料中,加入最新的版本號碼 (進管理介面點選資料的Source標籤就可以看到)
 curl -X PUT http://127.0.0.1:5984/test/"0bb149459127c0ee3a7d047d10eb"
    -d '{
        "_id": "db",
        "_rev": "7974-e1723f478aa69889e21f288ab14ab03d",
        "data": "test"
        }'

2011年11月11日 星期五

用Homebrew安裝CouchDB

# 安裝指令
brew install couchdb

# 啟動 CouchDB 並且背景執行
couchdb -b

# 打開管理頁面,time to relax
http://127.0.0.1:5984/_utils/index.html

# 關閉 CouchDB
couchdb -k