Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Azure Cosmos sample for .NET for Bulk ingestion and capabilities on Graph API accounts

This project is a sample of how the Cosmos DB V3 SQL SDK can be used to process Gremlin/Graph data leveraging the Bulk mode.

It can be used for migration scenarios when moving from Microsoft.Azure.CosmosDB.BulkExecutor.Graph.GraphBulkExecutor.

Sample usage

Full sample code available: https://github.com/Azure-Samples/azure-cosmos-graph-bulk-executor/blob/main/dotnet/src/Sample

GraphBulkExecutor graphBulkExecutor = new GraphBulkExecutor("MyConnectionString", "myDatabase", "myContainer");

List<IGremlinElement> gremlinElements = new List<IGremlinElement>();
gremlinElements.AddRange(Program.GenerateVertices(Program.documentsToInsert));
gremlinElements.AddRange(Program.GenerateEdges(Program.documentsToInsert));
BulkOperationResponse bulkOperationResponse = await graphBulkExecutor.BulkImportAsync(
    gremlinElements: gremlinElements,
    enableUpsert: true);