Package com.datastax.astra.client
package com.datastax.astra.client
Entrypoint and core classes for the client.
Usage Logic In a nutshell
// Initialize client DataAPIClient client = new DataAPIClient("token");;
// Database (crud for collections) work with an assigned namespace Database db = client.getDatabase("api_endpoint", "default_keyspace"); db.createCollection("my_collection", 4, SimilarityMetric.cosine);
// Access to the data (crud for documents) Collection<Document> collection = db.getCollection("my_collection"); collection.insertOne(Document.create(1).append("hello", "world")); collection.insertOne(Document.create(2).append("hello", "world"), new float[] {.1f, .1f, .2f, .3f}); collection.findOne(eq(1)).ifPresent(System.out::println); collection.deleteOne(eq(1));
-
ClassDescriptionCollection<T>A Data API collection, the main object to interact with the Data API, especially for DDL operations.Serves as the primary entry point to the Data API client, offering streamlined access to the functionalities provided by the Data API, whether deployed within Astra environments or on-premise DataStax Enterprise installations.Provides utility methods for initializing and configuring clients to interact with the Data API.Options to set up the client for DataApiClient.Builder for the DataAPIClientOptions.Represent the destination of the data API.Subclass to represent an http proxy.A Data API database.