Data API vector collection non-astra

Number of APIs: 10

To run Data API commands in Qodex:

  1. Create a keyspace in cqlsh.
  2. Define local variables here in Qodex with values specific to your vector-enabled database. In the Data API calls here in Qodex, you'll need the appropriate values for DBAPPLICATIONTOKEN, DBAPIENDPOINT, DBKEYSPACE, and DBCOLLECTION. See the Data API v1 for non-Astra DB Vector databases environment and adjust for your values.
  3. In Qodex, only change the Current value of your local variables. And be sure to Save the local variable definitions.
  4. Download and install the [Qodex app,] if you haven't already.

TIP: Notice in the Data API commands:

  • The fully qualified url path -- before the collection has been created, or when you want to find or delete an existing collection -- is: DBAPIENDPOINT/DB_KEYSPACE
  • Once the collection has been created, the fully qualified url path is: DBAPIENDPOINT/DBKEYSPACE/DBCOLLECTION_

After stepping through all the commands, you can reset the example data and start over by executing the final call, deleteCollection.

About local variables: Here's an example of the local Variables UI in Qodex (with redacted ID values) for a vector-enabled Astra DB Serverless database:

  1. Insert data - insertMany documents with $vectorize POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_VECTORIZE_COLLECTION}}

  2. Find and modify data - findOneAndDelete with $vectorize POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}

  3. Delete data - deleteMany - delete by status POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}

  4. Delete data - deleteCollection - delete by collection name, vectorize POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}

  5. Insert data - insertMany documents with $vector POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}

  6. Create namespaces - createNamespace POST {{DB_API_ENDPOINT}}

  7. Find data - find with pagingState: to get all purchases showing Page 2 results POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}

  8. Find data - find sorted by $vectorize search, projection enabled, return similarity scores POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_VECTORIZE_COLLECTION}}

  9. Create and find collections - findCollections POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}

  10. Update data - updateMany - Set element value POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}