azcosmos-example

Setup

Setup environment variables

export DOCUMENT_DB_URI="https://<DB NAME>.documents.azure.com:443/"
export DOCUMENT_DB_PRIMARY_KEY="<PRIMARY KEY>"

Modify dbName/containerName to match database/container names.

go build main.go

Usage

Create item

./main -id 1 -create "test val"

Read item

./main -id 1 -read

Replace item

./main -id 1 -replace "replaced test val"

Delete item

./main -id 1 -delete

GitHub

View Github