I am trying to use BulkDelete function (for Cosmos DB graph database) that takes a string query and deletes all results, in my .NET C# application. Documentation: https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmosdb.bulkexecutor.graph.graphbulkexecutor.bulkdeleteasync?view=azure-dotnet
Since I don't know the Ids and partition keys of vertices and edges to be deleted in the graph, I can't use this BulkDelete API: https://github.com/Azure/azure-cosmosdb-bulkexecutor-dotnet-getting-started#bulk-delete-api
Using CosmosDB.BulkExecutor.Graph.GraphBulkExecutor.BulkDeleteAsync (that takes in query as as string) throws this exception:
System.NotImplementedException: The method or operation is not implemented. at Microsoft.Azure.CosmosDB.BulkExecutor.Graph.GraphBulkExecutor.BulkDeleteAsync(String query, Nullable`1 deleteBatchSize, CancellationToken cancellationToken) at ...
relevant code snippet:
// Prepare for bulk delete
var bulkExecutor = new GraphBulkExecutor(client, dataCollection);
await bulkExecutor.InitializeAsync();
var cancellationToken = new CancellationTokenSource().Token;
string query = "g.V().hasLabel('user')";
BulkDeleteResponse bulkDeleteResponse = null;
try
{
bulkDeleteResponse = await bulkExecutor.BulkDeleteAsync(query, 1000, cancellationToken);
PrintSummaryofBulkDelete(bulkDeleteResponse);
}
catch (DocumentClientException de)
{
LogUtility.Error("Document client exception: {0}", de);
}
catch (Exception e)
{
LogUtility.Error("Exception: {0}", e);
}
Is is really not implemented or am I making a mistake in using it?