> For the complete documentation index, see [llms.txt](https://docs.zingg.ai/zingg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zingg.ai/zingg/connect-your-data/connect-nosql-databases.md).

# Connect NoSQL Databases

Connect Zingg to Cassandra and MongoDB as data sources and output destinations.

{% hint style="success" icon="right-long" %}
New to Zingg pipes? Understand how pipes work before configuring them - [Pipes and data connections](/zingg/connect-your-data/pipes-and-data-connections.md).
{% endhint %}

{% hint style="success" icon="right-long" %}
This page covers NoSQL database connections.

* For relational databases see [Connect Relational Databases](/zingg/connect-your-data/connect-relational-databases.md).
* For cloud warehouses see [Connect Cloud Warehouses](/zingg/connect-your-data/connect-cloud-warehouses.md).

All NoSQL connectors are available in Community and Enterprise.
{% endhint %}

{% tabs %}
{% tab title="Cassandra" %}
{% hint style="success" icon="right-long" %}
The config below shows Cassandra as a write destination (output).

To read FROM Cassandra, use the same props under "`data`" with `args.setData()`.
{% endhint %}

### Python API

```python
from zingg.client import*
from zingg.pipes import*

cassandraPipe =
Pipe("sampleTest", "CASSANDRA")
cassandraPipe.addProperty("table", "dataschematest")
cassandraPipe.addProperty("keyspace", "zingg")
cassandraPipe.addProperty("cluster", "zingg")
cassandraPipe.addProperty("spark.cassandra.connection.host", "192.168.0.6")
args.setOutput(cassandraPipe)
```

### **JSON Config**

```json
{
  "output" : [ {
    "name" : "sampleTest",
    "format" : "CASSANDRA",
    "props" : {
      "table" : "dataschematest",
      "keyspace" : "zingg",
      "cluster" : "zingg",
      "spark.cassandra.connection.host" : "192.168.0.6"
    },
    "sparkProps" : {"spark.cassandra.connection.host" : "127.0.0.1"},
    "mode" : "Append"
  } ]
}
```

{% endtab %}

{% tab title="MongoDB" %}

### Python API

```python
from zingg.client import*
from zingg.pipes import*

mongoPipe =
Pipe("mongodb", "mongo")
mongoPipe.addProperty("uri", "mongodb://127.0.0.1/people.contacts")
args.setData(mongoPipe)
```

### JSON Config

```json
{
  "data" : [ {
    "name" : "mongodb",
    "format" : "mongo",
    "props" : {"uri" : "mongodb://127.0.0.1/people.contacts"}
  } ]
}
```

{% hint style="danger" icon="right-long" %}

* URI format: `mongodb://host:port/database.collection`
* Authenticated: `mongodb://user:password@host:port/database.collection`
  {% endhint %}

{% hint style="success" icon="right-long" %}
**Read more**:

* For relational databases - [Connect Relational Databases](/zingg/connect-your-data/connect-relational-databases.md)
* For cloud warehouses - [Connect Cloud Warehouses](/zingg/connect-your-data/connect-cloud-warehouses.md)
  {% endhint %}
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zingg.ai/zingg/connect-your-data/connect-nosql-databases.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
