dmyyy / azcosmos-example

Simple example program using CRUD operations to interface with azcosmos based on https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/data/azcosmos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Simple example program using CRUD operations to interface with azcosmos based on https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/data/azcosmos


Languages

Language:Go 100.0%