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(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.

query(SqlQuerySpec, FeedOptions)

Query all User Defined Functions.

query<T>(SqlQuerySpec, FeedOptions)

Query all User Defined Functions.

readAll(FeedOptions)

Read all User Defined Functions.

Example

Read all User Defined Functions to array.

const {body: udfList} = await container.userDefinedFunctions.readAll().fetchAll();

Property Details

container

container: Container

Property Value

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

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

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

Returns