Updated to have a write client and multiple read clients. Added enum to help with selection of client based on needed operation.

Need to modify endpoint selection in CosmosClient to select endpoints based on client called.
This commit is contained in:
Craig Boger (from Dev Box)
2024-02-20 16:31:42 -08:00
parent 4c61cfef58
commit 56f50e1320
35 changed files with 193 additions and 350 deletions

View File

@@ -1,7 +1,7 @@
import { JSONObject, OperationResponse } from "@azure/cosmos";
import { CollectionBase } from "../../Contracts/ViewModels";
import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationConsoleUtils";
import { client } from "../CosmosClient";
import { ClientOperationType, client } from "../CosmosClient";
import { handleError } from "../ErrorHandlingUtils";
export const bulkCreateDocument = async (
@@ -13,7 +13,7 @@ export const bulkCreateDocument = async (
);
try {
const response = await client()
const response = await client(ClientOperationType.WRITE)
.database(collection.databaseId)
.container(collection.id())
.items.bulk(