Data API vector collection non-astra
Number of APIs: 10
To run Data API commands in Qodex:
- Create a keyspace in cqlsh.
- 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.
- In Qodex, only change the Current value of your local variables. And be sure to Save the local variable definitions.
- 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:
-
Insert data - insertMany documents with $vectorize POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_VECTORIZE_COLLECTION}}
-
Find and modify data - findOneAndDelete with $vectorize POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}
-
Delete data - deleteMany - delete by status POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}
-
Delete data - deleteCollection - delete by collection name, vectorize POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}
-
Insert data - insertMany documents with $vector POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}
-
Create namespaces - createNamespace POST {{DB_API_ENDPOINT}}
-
Find data - find with pagingState: to get all purchases showing Page 2 results POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}
-
Find data - find sorted by $vectorize search, projection enabled, return similarity scores POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_VECTORIZE_COLLECTION}}
-
Create and find collections - findCollections POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}
-
Update data - updateMany - Set element value POST {{DB_API_ENDPOINT}}/{{DB_KEYSPACE}}/{{DB_COLLECTION}}