60 lines
1.1 KiB
HTTP
60 lines
1.1 KiB
HTTP
@couchDB = http://{{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}@couchdb.localhost
|
|
|
|
### Init
|
|
|
|
POST {{couchDB}}/_cluster_setup
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"action": "enable_single_node",
|
|
"username": "{{$dotenv COUCHDB_USER}}",
|
|
"password": "{{$dotenv COUCHDB_PASSWORD}}",
|
|
"bind_address": "0.0.0.0",
|
|
"port": 5984
|
|
}
|
|
|
|
### Creates a new database.
|
|
GET {{couchDB}}/_users
|
|
|
|
###
|
|
|
|
GET {{couchDB}}/_all_dbs
|
|
|
|
### Creates a new database.
|
|
PUT {{couchDB}}/db
|
|
|
|
### Creates a new document in the specified database, using the supplied JSON document structure.
|
|
POST {{couchDB}}/db
|
|
Accept: application/json
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"servings": 4,
|
|
"subtitle": "Delicious with fresh bread",
|
|
"title": "Fish Stew"
|
|
}
|
|
|
|
###
|
|
GET {{couchDB}}/db/_all_docs
|
|
|
|
###
|
|
GET {{couchDB}}/db/df9679762e2630b609a69ecf9c000d67
|
|
|
|
###
|
|
POST {{couchDB}}/db/_find
|
|
Accept: application/json
|
|
Content-Type: application/json
|
|
Content-Length: 168
|
|
Host: localhost:5984
|
|
|
|
{
|
|
"selector": {
|
|
"year": {"$gt": 2010}
|
|
},
|
|
"fields": ["_id", "_rev", "year", "title"],
|
|
"sort": [{"year": "asc"}],
|
|
"limit": 2,
|
|
"skip": 0,
|
|
"execution_stats": true
|
|
}
|