Conflicts class
Constructors
| Conflicts(Container, Client |
Eigenschappen
| container |
Methoden
| query(string | Sql |
Voert query's uit op alle conflicten. |
| query<T>(string | Sql |
Voert query's uit op alle conflicten. Voorbeeld Queryconflict met id
|
| read |
Alle conflicten lezen Voorbeeld
|
Constructordetails
Conflicts(Container, ClientContext)
new Conflicts(container: Container, clientContext: ClientContext)
Parameters
- container
- Container
- clientContext
-
ClientContext
Eigenschapdetails
container
Methodedetails
query(string | SqlQuerySpec, FeedOptions)
Voert query's uit op alle conflicten.
function query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<any>
Parameters
- query
-
string | SqlQuerySpec
Queryconfiguratie voor de bewerking. Zie SqlQuerySpec- voor meer informatie over het configureren van een query.
- options
- FeedOptions
Hiermee kunt u opties instellen, zoals het paginaformaat van het antwoord, vervolgtokens, enzovoort.
Retouren
QueryIterator<any>
QueryIterator- Hiermee kunt u resultaten in een matrix retourneren of ze één voor één herhalen.
query<T>(string | SqlQuerySpec, FeedOptions)
Voert query's uit op alle conflicten.
Voorbeeld
Queryconflict met id
import { CosmosClient, SqlQuerySpec } 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 querySpec: SqlQuerySpec = {
query: `SELECT * FROM root r WHERE r.id = @conflict`,
parameters: [{ name: "@conflict", value: "<conflict-id>" }],
};
const { resources: conflict } = await container.conflicts.query(querySpec).fetchAll();
function query<T>(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<T>
Parameters
- query
-
string | SqlQuerySpec
Queryconfiguratie voor de bewerking. Zie SqlQuerySpec- voor meer informatie over het configureren van een query.
- options
- FeedOptions
Hiermee kunt u opties instellen, zoals het paginaformaat van het antwoord, vervolgtokens, enzovoort.
Retouren
QueryIterator- Hiermee kunt u resultaten in een matrix retourneren of ze één voor één herhalen.
readAll(FeedOptions)
Alle conflicten lezen
Voorbeeld
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 { resources: conflicts } = await container.conflicts.readAll().fetchAll();
function readAll(options?: FeedOptions): QueryIterator<ConflictDefinition & Resource>
Parameters
- options
- FeedOptions
Hiermee kunt u opties instellen, zoals het paginaformaat van het antwoord, vervolgtokens, enzovoort.