couchdb

CouchDB是一个开源的面向文档的数据库管理系统,建立于 C++ 之上。

ui

http://192.168.200.16:5984/_utils/#/_all_dbs

curl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
http://admin:admin@192.168.200.16:5984/_utils/#/_all_dbs

curl -X PUT http://admin:admin@192.168.200.16:5984/test

curl -X GET http://admin:admin@192.168.200.16:5984/test

curl -X DELETE http://admin:admin@192.168.200.16:5984/test

curl -X PUT http://admin:admin@192.168.200.16:5984/test/"002" -d "{\"Name\":\"Raju\",\"age\":\"23\"}"

curl -X GET http://admin:admin@192.168.200.16:5984/test/"002"
{"_id":"002","_rev":"1-d72ed8577c9b1547dec5052cd503b359","Name":"Raju","age":"23"}

curl -X PUT http://admin:admin@192.168.200.16:5984/test/"002" -d "{\"Name\":\"Raju\",\"age\":\"24\",\"_rev\":\"1-d72ed8577c9b1547dec5052cd503b359\"}"

curl -X GET http://admin:admin@192.168.200.16:5984/test/"002"
{"_id":"002","_rev":"2-f2716b3df54d9bbbc7d9b4eafe965354","Name":"Raju","age":"24"}

curl -X GET http://admin:admin@192.168.200.16:5984/test/"003"
{"_id":"003","_rev":"1-d72ed8577c9b1547dec5052cd503b359","Name":"Raju","age":"23"}
curl -X DELETE http://admin:admin@192.168.200.16:5984/test/"003"?rev=1-d72ed8577c9b1547dec5052cd503b359
curl -X GET http://admin:admin@192.168.200.16:5984/test/"003"
{"error":"not_found","reason":"deleted"}

查询

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
### ip192d168d129d162
POST http://192.168.200.16:5984/ip192d168d129d162/_find
authorization: Basic YWRtaW46YWRtaW4=
Content-Type: application/json

{
   "selector": {
      "datetime": {
         "$gte": 20220517000000000
      }
   },
   "sort":[{"datetime":"desc"}],
   "bookmark":"",
   "limit": 1000,
   "fields": ["dateformat","data"],
   "execution_stats": true
}