ealsur / GraphBulkExecutorV3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This repository has been archived and the content promoted as an official Azure Sample: https://github.com/Azure-Samples/azure-cosmos-graph-bulk-executor/tree/main/dotnet

GraphBulkExecutorV3

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 code available: https://github.com/ealsur/GraphBulkExecutorV3/blob/main/Sample/Program.cs

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);

About

License:MIT License


Languages

Language:C# 100.0%