These are example CouchDB database(s), styled after the examples used in the CouchDB documentation.
It is a companion repository for Neighbourhoodie's CouchDB Training offerings.
These instructions assume you already have a CouchDB installation on your local machine, and that it is running in the background.
- Install Node.js. Any recent version (as of 2021) is fine.
- Obtain a copy of this repository, using
git
or by downloading the zip file from GitHub and extracting it. - Open a shell, terminal, or command prompt, and change directories into wherever you put a copy of this repo.
- Install the example by typing:
npx couchdb-bootstrap http://admin:password@localhost:5984 examples
substituting your CouchDB username and password foradmin
andpassword
.
These documents have UTF-8 contents. If you are running on Microsoft Windows, output may appear mangled by default. To correct this, type:
chcp 65001
before working with these examples.
When running curl.exe
commands using the Command Prompt, be sure to surround
any inline documents with double-quotes ("
) and to double up any double-
quotes inside of the string, like this:
curl -X POST -H "Content-Type:application/json" http://admin:password@localhost:5984/ghibli/_find -d "{""selector"":{""type"": ""director""}}"
These documents have UTF-8 contents. If you are running on Microsoft Windows, output may appear mangled by default. To correct this, type:
$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8
before working with these examples.
When running curl.exe
commands using the Command Prompt, be sure to surround
any inline documents with single-quotes ('
) and to double up any double-
quotes inside of the string, like this:
curl.exe -s -X POST -H "Content-Type:application/json" http://admin:password@localhost:5984/ghibli/_find -d '{""selector"":{""type"": ""director""}}'
Be sure to use curl.exe
and not the built-in PowerShell curl
command, as
the syntax is significantly different from that used in the course.
It is also recommended to use the -s
option to curl.exe
to prevent its
progress bar output from confusing PowerShell.