Share via


Conflict class

Use to read or delete a given Conflict by id.

See Conflicts to query or read all conflicts.

Properties

container
id
url

Returns a reference URL to the resource. Used for linking in Permissions.

Methods

delete(RequestOptions)

Delete the given ConflictDefinition.

Example

import { CosmosClient } from "@azure/cosmos";

const endpoint = "https://your-account.documents.azure.com";
const key = "<database account masterkey>";
const client = new CosmosClient({ endpoint, key });
const { database } = await client.databases.createIfNotExists({ id: "Test Database" });
const container = database.container("Test Container");

await container.conflict("<conflict-id>").delete();
read(RequestOptions)

Read the ConflictDefinition for the given Conflict.

Example

import { CosmosClient } from "@azure/cosmos";

const endpoint = "https://your-account.documents.azure.com";
const key = "<database account masterkey>";
const client = new CosmosClient({ endpoint, key });
const { database } = await client.databases.createIfNotExists({ id: "Test Database" });
const container = database.container("Test Container");

const { resource: conflict } = await container.conflict("<conflict-id>").read();

Property Details

container

container: Container

Property Value

id

id: string

Property Value

string

url

Returns a reference URL to the resource. Used for linking in Permissions.

string url

Property Value

string

Method Details

delete(RequestOptions)

Delete the given ConflictDefinition.

Example

import { CosmosClient } from "@azure/cosmos";

const endpoint = "https://your-account.documents.azure.com";
const key = "<database account masterkey>";
const client = new CosmosClient({ endpoint, key });
const { database } = await client.databases.createIfNotExists({ id: "Test Database" });
const container = database.container("Test Container");

await container.conflict("<conflict-id>").delete();
function delete(options?: RequestOptions): Promise<ConflictResponse>

Parameters

options
RequestOptions

Returns

Promise<ConflictResponse>

read(RequestOptions)

Read the ConflictDefinition for the given Conflict.

Example

import { CosmosClient } from "@azure/cosmos";

const endpoint = "https://your-account.documents.azure.com";
const key = "<database account masterkey>";
const client = new CosmosClient({ endpoint, key });
const { database } = await client.databases.createIfNotExists({ id: "Test Database" });
const container = database.container("Test Container");

const { resource: conflict } = await container.conflict("<conflict-id>").read();
function read(options?: RequestOptions): Promise<ConflictResponse>

Parameters

options
RequestOptions

Returns

Promise<ConflictResponse>