UserDefinedFunctions class
Used to create, upsert, query, or read all User Defined Functions.
See UserDefinedFunction to read, replace, or delete a given User Defined Function by id.
Properties
container |
Methods
create(User |
Create a UserDefinedFunction. Azure Cosmos DB supports JavaScript UDFs which can be used inside queries, stored procedures and triggers. For additional details, refer to the server-side JavaScript API documentation. |
query(Sql |
Query all User Defined Functions. |
query<T>(Sql |
Query all User Defined Functions. |
read |
Read all User Defined Functions. Example Read all User Defined Functions to array.
|
Property Details
container
Method Details
create(UserDefinedFunctionDefinition, RequestOptions)
Create a UserDefinedFunction.
Azure Cosmos DB supports JavaScript UDFs which can be used inside queries, stored procedures and triggers.
For additional details, refer to the server-side JavaScript API documentation.
function create(body: UserDefinedFunctionDefinition, options?: RequestOptions): Promise<UserDefinedFunctionResponse>
Parameters
- options
- RequestOptions
Returns
Promise<UserDefinedFunctionResponse>
query(SqlQuerySpec, FeedOptions)
Query all User Defined Functions.
function query(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<any>
Parameters
- query
- SqlQuerySpec
Query configuration for the operation. See SqlQuerySpec for more info on how to configure a query.
- options
- FeedOptions
Returns
QueryIterator<any>
query<T>(SqlQuerySpec, FeedOptions)
Query all User Defined Functions.
function query<T>(query: SqlQuerySpec, options?: FeedOptions): QueryIterator<T>
Parameters
- query
- SqlQuerySpec
Query configuration for the operation. See SqlQuerySpec for more info on how to configure a query.
- options
- FeedOptions
Returns
readAll(FeedOptions)
Read all User Defined Functions.
Example
Read all User Defined Functions to array.
const {body: udfList} = await container.userDefinedFunctions.readAll().fetchAll();
function readAll(options?: FeedOptions): QueryIterator<UserDefinedFunctionDefinition & Resource>
Parameters
- options
- FeedOptions