Files
sql/couchdb.http
2025-10-14 23:27:54 +02:00

57 lines
1.1 KiB
HTTP

@couchDB = http://{{$dotenv COUCHDB_USER}}:{{$dotenv COUCHDB_PASSWORD}}@couchdb.localhost
###
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
}
###
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
}