neighbourhoodie / couchdb-examples

Database examples to go with Neighbourhoodie's CouchDB Training offerings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Neighbourhoodie Examples

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.

Installation Instructions

These instructions assume you already have a CouchDB installation on your local machine, and that it is running in the background.

  1. Install Node.js. Any recent version (as of 2021) is fine.
  2. Obtain a copy of this repository, using git or by downloading the zip file from GitHub and extracting it.
  3. Open a shell, terminal, or command prompt, and change directories into wherever you put a copy of this repo.
  4. Install the example by typing: npx couchdb-bootstrap http://admin:password@localhost:5984 examples substituting your CouchDB username and password for admin and password.

Helpful Hints on Windows computers

Command Prompt

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""}}"

PowerShell

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.

About

Database examples to go with Neighbourhoodie's CouchDB Training offerings.

License:Apache License 2.0