[P2] Add Bulk Write Operations (upsert, update, delete)

Open
#107 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
45/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
csharp
Domain
cli, database

Research direction

Start by inspecting the existing mkitem array-input command and the shell's command entry points to understand how batch operations are currently handled. Define the supported bulk commands, input forms, concurrency behavior, progress and cost reporting, then add coverage for the agreed behavior; done means the scope and completion criteria are confirmed for upsert, delete, and patch.

Written by the indexing model from the issue text.

Description

enhancement

Feature Request

Priority: P2 (Medium)

Description

CosmosDB Shell supports array input for mkitem (batch create) but lacks bulk upsert, update, and delete operations. Bulk operations are critical for data migration and maintenance tasks.

Comparable Features in Other Shells
  • mongosh: bulkWrite(), ordered/unordered bulk operations
  • sqlcmd: Bulk insert via bcp
Proposed Behavior

Add a bulk command or extend existing commands:

  • bulk upsert <file> — Bulk upsert from JSON array or file
  • bulk delete <query> — Bulk delete matching documents
  • bulk patch <file> — Bulk patch operations
  • Support concurrency control (max parallelism)
  • Report progress, success/failure counts, and total RU cost
Example Usage
bulk upsert ./updates.json --max-parallelism 10
bulk delete "SELECT c.id, c.pk FROM c WHERE c.expired = true"
bulk patch ./patches.json
Dominant language
C#
Stars
3
Forks
7
Avg merge
1d 9h
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/CosmosDBShell

All issues in Azure/CosmosDBShell

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.