Offers class
속성
| client |
메서드
| query(Sql |
모든 제품을 쿼리합니다. 예제 특정 ID에 대한 제안을 읽습니다.
|
| query<T>(Sql |
모든 제품을 쿼리합니다. |
| read |
모든 제품을 읽습니다. 예제 배열에 대한 모든 제안을 읽습니다.
|
속성 세부 정보
client
메서드 세부 정보
query(SqlQuerySpec, FeedOptions)
모든 제품을 쿼리합니다.
예제
특정 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 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>
매개 변수
- query
- SqlQuerySpec
작업에 대한 쿼리 구성입니다. 쿼리를 구성하는 방법에 대한 자세한 내용은 SqlQuerySpec 참조하세요.
- options
- FeedOptions
반환
QueryIterator<any>
query<T>(SqlQuerySpec, FeedOptions)
모든 제품을 쿼리합니다.
function query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>
매개 변수
- query
- SqlQuerySpec
작업에 대한 쿼리 구성입니다. 쿼리를 구성하는 방법에 대한 자세한 내용은 SqlQuerySpec 참조하세요.
- options
- FeedOptions
반환
readAll(FeedOptions)
모든 제품을 읽습니다.
예제
배열에 대한 모든 제안을 읽습니다.
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>
매개 변수
- options
- FeedOptions