Difficulty: Beginner
Estimated Time: 15 minutes

Built around JSON-like documents, document model databases are both natural and flexible for developers to work with.

The Stargate open source project provides an API layer that allows you to expose a document-style API on top of any Cassandra database.

Astra DB now offers a Document API via Stargate, which allows you to use your Astra DB database as a document database. Create collections, add documents and modify them within your database.

In this scenario we will:

  • Create a new collection and add a document
  • Read the document back from the database
  • Read a subdocument from the database
  • Update a document
  • Replace a subdocument
  • Delete a document from the database

Before we begin

As a prerequisite, be sure to setup an Astra account and create a Cassandra as a Service database at astra.datastax.com.

Let's get started with Stargate Document API on Astra DB!

This scenario is also available on our datastax.com/dev site, where you can find many more resources to help you succeed with Apache Cassandra™.

Code Complete

Thanks for taking a tour of Stargate's Document API on Astra DB! For more details and elaboration of the Document API features check out the Stargate documentation.

For more information and details on using the Document API on Astra DB read the documentation.

Please give this scenario a rating (click on the stars near the top).

Have questions or more feedback? Send us a message.

Getting Started with Stargate Document API for Cassandra™

Step 1 of 8

Watch an introductory video on the Document API

Here's a short video that shows how to use the Document API.

You can enlarge the video to full-screen by clicking in the bottom-right corner of the video.

Now, you give it a try!