Database Management

To show the servers API curl will be used to interact with the database. The examples assume the server to be running on the some host and listening on the port 1338.

List all Databases

curl http://127.0.0.1:1338/_all_dbs

Create a Database

Create a Database with name 'myDb'. The empty body will let curl set the Content-Length header which Stairtower requires for PUT and POST requests

curl -X PUT http://127.0.0.1:1338/myDb -d ""

# Listing all databases should contain 'myDb'
curl http://127.0.0.1:1338/_all_dbs

# Listing the Documents of 'myDb' should return 
# an empty array
curl http://127.0.0.1:1338/myDb

Delete a Database

Deletion of a whole Database is similar to removing a single Document. You simply omit the Document identifier when sending a DELETE request.

curl -X DELETE http://127.0.0.1:1338/myDb/

Count

Returns the number of Documents in the Database

curl http://127.0.0.1:1338/myDb/_describe