Table of Contents

Class StoredProcedureProperties

Namespace
Microsoft.Azure.Cosmos.Scripts
Assembly
Microsoft.Azure.Cosmos.Client.dll

Represents a stored procedure in the Azure Cosmos DB service.

public class StoredProcedureProperties
Inheritance
StoredProcedureProperties
Inherited Members
Extension Methods

Remarks

Azure Cosmos DB allows application logic written entirely in JavaScript to be executed directly inside the database engine under the database transaction. For additional details, refer to the server-side JavaScript API documentation.

Constructors

StoredProcedureProperties()

Initializes a new instance of the Stored Procedure class for the Azure Cosmos DB service.

public StoredProcedureProperties()

StoredProcedureProperties(string, string)

Initializes a new instance of the Stored Procedure class for the Azure Cosmos DB service.

public StoredProcedureProperties(string id, string body)

Parameters

id string

The Id of the resource in the Azure Cosmos service.

body string

The body of the Azure Cosmos DB stored procedure.

Properties

Body

Gets or sets the body of the Azure Cosmos DB stored procedure.

public string Body { get; set; }

Property Value

string

The body of the stored procedure.

Remarks

Must be a valid JavaScript function. For e.g. "function () { getContext().getResponse().setBody('Hello World!'); }"

ETag

Gets the entity tag associated with the resource from the Azure Cosmos DB service.

public string ETag { get; }

Property Value

string

The entity tag associated with the resource.

Remarks

ETags are used for concurrency checking when updating resources.

Id

Gets or sets the Id of the resource in the Azure Cosmos DB service.

public string Id { get; set; }

Property Value

string

The Id associated with the resource.

Remarks

Every resource within an Azure Cosmos DB database account needs to have a unique identifier.

The following characters are restricted and cannot be used in the Id property: '/', '\\', '?', '#'

LastModified

Gets the last modified timestamp associated with StoredProcedureProperties from the Azure Cosmos DB service.

public DateTime? LastModified { get; }

Property Value

DateTime?

The last modified timestamp associated with the resource.

Gets the self-link associated with the resource from the Azure Cosmos DB service.

public string SelfLink { get; }

Property Value

string

The self-link associated with the resource.

A self-link is a static addressable Uri for each resource within a database account and follows the Azure Cosmos DB resource model. E.g. a self-link for a document could be dbs/db_resourceid/colls/coll_resourceid/documents/doc_resourceid