Azure / Azure/CosmosDBShell

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

Open
#107 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
3
Forks
7
Avg merge
1d 12h
Merged PRs (30d)
14

Description

## 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 ` — Bulk upsert from JSON array or file
- `bulk delete ` — Bulk delete matching documents
- `bulk patch ` — 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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.