Class ModifyStatement<T>
Represents a chaining collection modify statement.
Namespace: MySqlX.XDevAPI.CRUD
Assembly: MySql.Data.dll
Version: 9.2.0
Syntax
public class ModifyStatement<T> : FilterableStatement<ModifyStatement<T>, Collection<T>, Result, T>
Type Parameters
Name | Description |
---|---|
T |
Methods
ArrayAppend(String, Object)
Appends an item to the specified array.
Declaration
public ModifyStatement<T> ArrayAppend(string docPath, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
docPath | The document path key. |
System. |
value | The value to append to the array. |
Returns
Type | Description |
---|---|
Modify |
A ModifyStatement<T> object containing the updated array. |
ArrayInsert(String, Object)
Inserts an item into the specified array.
Declaration
public ModifyStatement<T> ArrayInsert(string field, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
field | The document path key including the index on which the item will be inserted. |
System. |
value | The value to insert into the array. |
Returns
Type | Description |
---|---|
Modify |
A ModifyStatement<T> object containing the updated array. |
Change(String, Object)
Changes value for a key.
Declaration
public ModifyStatement<T> Change(string docPath, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
docPath | The document path key. |
System. |
value | The new value. |
Returns
Type | Description |
---|---|
Modify |
This ModifyStatement<T> object. |
Execute()
Executes the modify statement.
Declaration
public override Result Execute()
Returns
Overrides
Patch(Object)
Creates a ModifyStatement<T> object set with the changes to be applied to all matching documents.
Declaration
public ModifyStatement<T> Patch(object document)
Parameters
Type | Name | Description |
---|---|---|
System. |
document | The JSON-formatted object describing the set of changes. |
Returns
Type | Description |
---|---|
Modify |
A ModifyStatement<T> object set with the changes described in |
Remarks
document
can be a Db
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
|
Set(String, Object)
Sets key and value.
Declaration
public ModifyStatement<T> Set(string docPath, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
docPath | The document path key. |
System. |
value | The new value. |
Returns
Type | Description |
---|---|
Modify |
This ModifyStatement<T> object. |
Sort(String[])
Allows the user to set the sorting criteria for the operation. The strings use normal SQL syntax like "order ASC" or "pages DESC, age ASC".
Declaration
public ModifyStatement<T> Sort(params string[] order)
Parameters
Type | Name | Description |
---|---|---|
System. |
order | The order criteria. |
Returns
Type | Description |
---|---|
Modify |
A generic object representing the implementing statement type. |
Unset(String[])
Removes keys or values from a document.
Declaration
public ModifyStatement<T> Unset(params string[] docPath)
Parameters
Type | Name | Description |
---|---|---|
System. |
docPath | An array of document paths representing the keys to be removed. |
Returns
Type | Description |
---|---|
Modify |
This ModifyStatement<T> object. |
Where(String)
Enables the setting of Where condition for this operation.
Declaration
[Obsolete("Where(string condition) has been deprecated since version 8.0.17.")]
public ModifyStatement<T> Where(string condition)
Parameters
Type | Name | Description |
---|---|---|
System. |
condition | The Where condition. |
Returns
Type | Description |
---|---|
Modify |
The implementing statement type. |