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"
        }'

沒有留言:

張貼留言