> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/open-source/use-harness-open-source/pipelines-1/samples/rethinkdb.md).

# Rethinkdb

## RethinkDB <a href="#rethinkdb" id="rethinkdb"></a>

This guide covers configuring continuous integration pipelines for projects that have a RethinkDB dependency.

### Basic Example <a href="#basic-example" id="basic-example"></a>

In the below example we demonstrate a pipeline that launches RethinkDB as a background step. The database server will be available at `database:28015`, where the hostname matches the background step name.

```yaml
kind: pipeline
spec:
  stages:
  - type: ci
    spec:
      steps:
      - name: database
        type: background
        spec:
          container: rethinkdb:2
          args:
          - rethinkdb
          - --bind
          - all

      - name: test
        type: run
        spec:
          container: node:9
          script: |-
            npm install -s -g recli
            recli -h database -j 'r.db("rethinkdb").table("stats")'
```

## Common Problems <a href="#common-problems" id="common-problems"></a>

### Incorrect Hostname <a href="#incorrect-hostname" id="incorrect-hostname"></a>

You cannot use `127.0.0.1` or `localhost` to connect with the database. If you are unable to connect please verify you are using the correct hostname, corresponding with the container name.

Bad:

```yaml
      - name: test
        type: run
        spec:
          container: node:9
          script: |-
            npm install -s -g recli
            recli -h localhost -j 'r.db("rethinkdb").table("stats")'
```

Good:

```yaml
      - name: test
        type: run
        spec:
          container: node:9
          script: |-
            npm install -s -g recli
            recli -h database -j 'r.db("rethinkdb").table("stats")'
```
