Files
sql/couchdb.http

64 lines
1.5 KiB
Plaintext
Raw Normal View History

2025-10-15 23:33:08 +02:00
@couchDB = http://couchdb.localhost
2025-10-14 21:11:54 +02:00
2025-10-15 07:30:31 +02:00
### Init
2025-10-14 23:27:54 +02:00
POST {{couchDB}}/_cluster_setup
2025-10-15 23:33:08 +02:00
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
2025-10-14 23:27:54 +02:00
Content-Type: application/json
{
"action": "enable_single_node",
"username": "{{$dotenv COUCHDB_USER}}",
"password": "{{$dotenv COUCHDB_PASSWORD}}",
"bind_address": "0.0.0.0",
"port": 5984
}
###
2025-10-14 21:11:54 +02:00
GET {{couchDB}}/_all_dbs
2025-10-15 23:33:08 +02:00
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
2025-10-14 21:11:54 +02:00
### Creates a new database.
PUT {{couchDB}}/db
2025-10-15 23:33:08 +02:00
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
2025-10-14 21:11:54 +02:00
### Creates a new document in the specified database, using the supplied JSON document structure.
POST {{couchDB}}/db
Accept: application/json
Content-Type: application/json
2025-10-15 23:33:08 +02:00
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
2025-10-14 21:11:54 +02:00
{
"servings": 4,
"subtitle": "Delicious with fresh bread",
"title": "Fish Stew"
}
###
GET {{couchDB}}/db/_all_docs
2025-10-15 23:33:08 +02:00
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
2025-10-14 21:11:54 +02:00
###
2025-10-15 23:33:08 +02:00
GET {{couchDB}}/db/2c2135ff744c3b98407572ed4f000cad
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
2025-10-14 21:11:54 +02:00
###
POST {{couchDB}}/db/_find
2025-10-15 23:33:08 +02:00
Authorization: Basic {{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}
2025-10-14 21:11:54 +02:00
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
}