DocumentClient.UpsertUserDefinedFunctionAsync
Method
Definition
Overloads
| UpsertUserDefinedFunctionAsync(Uri, UserDefinedFunction, RequestOptions) |
Upserts a user defined function as an asychronous operation in the Azure DocumentDB database service. |
| UpsertUserDefinedFunctionAsync(String, UserDefinedFunction, RequestOptions) |
Upserts a user defined function as an asychronous operation in the Azure DocumentDB database service. |
UpsertUserDefinedFunctionAsync(Uri, UserDefinedFunction, RequestOptions)
Upserts a user defined function as an asychronous operation in the Azure DocumentDB database service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.UserDefinedFunction>> UpsertUserDefinedFunctionAsync (Uri documentCollectionUri, Microsoft.Azure.Documents.UserDefinedFunction function, Microsoft.Azure.Documents.Client.RequestOptions options = null);
- documentCollectionUri
- Uri
the URI of the document collection to upsert the user defined function in.
- function
- UserDefinedFunction
the Microsoft.Azure.Documents.UserDefinedFunction object.
- options
- RequestOptions
The request options for the request.
The task object representing the service response for the asynchronous operation.
UpsertUserDefinedFunctionAsync(String, UserDefinedFunction, RequestOptions)
Upserts a user defined function as an asychronous operation in the Azure DocumentDB database service.
public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.UserDefinedFunction>> UpsertUserDefinedFunctionAsync (string collectionLink, Microsoft.Azure.Documents.UserDefinedFunction function, Microsoft.Azure.Documents.Client.RequestOptions options = null);
- collectionLink
- String
The link of the DocumentCollection to upsert the user defined function in. E.g. dbs/db_rid/colls/col_rid/
- function
- UserDefinedFunction
The UserDefinedFunction object to upsert.
- options
- RequestOptions
(Optional) Any RequestOptionsfor this request.
A task object representing the service response for the asynchronous operation.
If either collectionLink or function is not set.
Represents a consolidation of failures that occured during async processing. Look within InnerExceptions to find the actual exception(s)
This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when creating a Document are:
| StatusCode | Reason for exception |
|---|---|
| 400 | BadRequest - This means something was wrong with the request supplied. It is likely that an Id was not supplied for the new user defined function or that the Body was malformed. |
| 403 | Forbidden - You have reached your quota of user defined functions for the collection supplied. Contact support to have this quota increased. |
| 409 | Conflict - This means a UserDefinedFunction with an id matching the id you supplied already existed. |
| 413 | RequestEntityTooLarge - This means the body of the UserDefinedFunction you tried to upsert was too large. |