DataStax Astra DB uses the Stargate Document API to modify and query data stored as unstructured JSON documents in collections. Because the Document API uses schemaless data, no data modeling is required!
The blog The Stargate Cassandra Documents API describes the underlying structure used to store collections.
To use the Document API, you must define the namespace that will store collections. Collections store unstructured JSON documents. Documents can themselves hold multiple documents. Multiple collections are contained in a namespace, but a collection cannot be contained in multiple namespaces.
Only namespaces need to specifically created. Collections are specified when a document is inserted.
You can access the Document API in a browser with Swagger UI at
Adding parameter information, you can generate
cURL commands to execute and
display results that will return.
Before you get started, set your environment variables to save time developing on your database.
In Astra, select the database to which you want to connect.
In your Database Dashboard, select Connect.
Select Document API.
If you have multiple regions, select the region you want to connect to from the dropdown menu for instructions.
Follow the steps in the prerequisites to get your application token and set up your environment variables.
In your command-line interface associated with your environment, paste the following environment variables copied for your Astra database:
export ASTRA_DB_ID=<database_id> export ASTRA_DB_REGION=<database_region> export ASTRA_DB_KEYSPACE=<keyspace_name> export ASTRA_DB_APPLICATION_TOKEN=<app_token>
Now you are ready to get started:
To view the API Reference, see Astra DB Document API.