Conflicts class
Konstruktoren
| Conflicts(Container, Client |
Eigenschaften
| container |
Methoden
| query(string | Sql |
Fragt alle Konflikte ab. |
| query<T>(string | Sql |
Fragt alle Konflikte ab. Beispiel Abfragekonflikt mit ID
|
| read |
Liest alle Konflikte Beispiel
|
Details zum Konstruktor
Conflicts(Container, ClientContext)
new Conflicts(container: Container, clientContext: ClientContext)
Parameter
- container
- Container
- clientContext
-
ClientContext
Details zur Eigenschaft
container
Details zur Methode
query(string | SqlQuerySpec, FeedOptions)
Fragt alle Konflikte ab.
function query(query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator<any>
Parameter
- query
-
string | SqlQuerySpec
Abfragekonfiguration für den Vorgang. Weitere Informationen zum Konfigurieren einer Abfrage finden Sie unter SqlQuerySpec-.
- options
- FeedOptions
Wird verwendet, um Optionen wie Antwortseitengröße, Fortsetzungstoken usw. festzulegen.
Gibt zurück
QueryIterator<any>
QueryIterator- Ermöglicht es Ihnen, Ergebnisse in einem Array zurückzugeben oder jeweils einzeln zu durchlaufen.
query<T>(string | SqlQuerySpec, FeedOptions)
Fragt alle Konflikte ab.
Beispiel
Abfragekonflikt mit 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>
Parameter
- query
-
string | SqlQuerySpec
Abfragekonfiguration für den Vorgang. Weitere Informationen zum Konfigurieren einer Abfrage finden Sie unter SqlQuerySpec-.
- options
- FeedOptions
Wird verwendet, um Optionen wie Antwortseitengröße, Fortsetzungstoken usw. festzulegen.
Gibt zurück
QueryIterator- Ermöglicht es Ihnen, Ergebnisse in einem Array zurückzugeben oder jeweils einzeln zu durchlaufen.
readAll(FeedOptions)
Liest alle Konflikte
Beispiel
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>
Parameter
- options
- FeedOptions
Wird verwendet, um Optionen wie Antwortseitengröße, Fortsetzungstoken usw. festzulegen.