Offers class
Properti
| client |
Metode
| query(Sql |
Kueri semua penawaran. Contoh Baca penawaran untuk id tertentu.
|
| query<T>(Sql |
Kueri semua penawaran. |
| read |
Baca semua penawaran. Contoh Baca semua penawaran ke array.
|
Detail Properti
client
Detail Metode
query(SqlQuerySpec, FeedOptions)
Kueri semua penawaran.
Contoh
Baca penawaran untuk id tertentu.
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 querySpec: SqlQuerySpec = {
query: `SELECT * FROM root r WHERE r.id = @offer`,
parameters: [{ name: "@offer", value: "<offer-id>" }],
};
const { resources: offer } = await client.offers.query(querySpec).fetchAll();
function query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>
Parameter
- query
- SqlQuerySpec
Konfigurasi kueri untuk operasi. Lihat SqlQuerySpec untuk informasi selengkapnya tentang cara mengonfigurasi kueri.
- options
- FeedOptions
Mengembalikan
QueryIterator<any>
query<T>(SqlQuerySpec, FeedOptions)
Kueri semua penawaran.
function query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>
Parameter
- query
- SqlQuerySpec
Konfigurasi kueri untuk operasi. Lihat SqlQuerySpec untuk informasi selengkapnya tentang cara mengonfigurasi kueri.
- options
- FeedOptions
Mengembalikan
readAll(FeedOptions)
Baca semua penawaran.
Contoh
Baca semua penawaran ke array.
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 { resources: offerList } = await client.offers.readAll().fetchAll();
function readAll(options?: FeedOptions): QueryIterator<OfferDefinition & Resource>
Parameter
- options
- FeedOptions