Class DeleteOptions
Represent options for the Delete operation.
Namespace: Oracle.NoSQL.SDK
Assembly: Oracle.NoSQL.SDK.dll
Syntax
public class DeleteOptions : Object
Remarks
These options are passed to APIs DeleteAsync(String, MapValue, DeleteOptions, CancellationToken)
and DeleteIfVersionAsync(String, MapValue, RowVersion, DeleteOptions, CancellationToken).
For properties not specified or
null
,
appropriate defaults will be used as indicated below.
Examples
Executing Delete operation with provided PutOptions.// We first call PutAsync to create a row and then use its version
// for the conditional Delete operation.
var putResult = await client.PutAsync("myTable",
new MapValue
{
["id"] = 1000,
["name"] = "John"
});
// Some time later we delete the row but only if it was not modified
// meanwhile (meaning its version has not changed).
var deleteResult = await client.DeleteAsync("myTable",
new MapValue
{
["id"] = 1000
},
new DeleteOptions
{
Timeout = TimeSpan.FromSeconds(10),
MatchVersion = getResult.Version,
ReturnExisting = true
});
Constructors
Name | Description |
---|---|
DeleteOptions() |
Properties
Name | Description |
---|---|
Compartment | Cloud service only. Gets or sets the compartment id or name for the operation. |
Durability | On-premise only. Gets or sets Durability value to use for the operation. |
MatchVersion | Gets or sets a value that determines whether to perform the Delete operation only if there is an existing row that matches the primary key and its RowVersion matches the value provided. |
Namespace | On-premises only. Gets or sets the optional namespace. |
ReturnExisting | Gets or sets a value that determines whether to return existing row and its RowVersion if the conditional Delete operation fails because of the version mismatch discussed in DeleteAsync(String, MapValue, DeleteOptions, CancellationToken). |
Timeout | Gets or sets the timeout for the request. |