deleteCollection method

Future<void> deleteCollection({
  1. String environment = 'us-west1-gcp-free',
  2. required String collectionName,
})

Delete collection

This operation deletes an existing collection.

environment: The region for your project. See Pinecone console

collectionName: Name of the collection to operate on.

DELETE https://controller.{environment}.pinecone.io/collections/{collectionName}

Implementation

Future<void> deleteCollection({
  String environment = 'us-west1-gcp-free',
  required String collectionName,
}) async {
  final _ = await makeRequest(
    baseUrl: 'https://controller.${environment}.pinecone.io',
    path: '/collections/$collectionName',
    method: HttpMethod.delete,
    isMultipart: false,
    requestType: '',
    responseType: '',
    headerParams: {
      if (apiKey.isNotEmpty) 'Api-Key': apiKey,
    },
  );
}