MySQL 8.4.2
Source Code Documentation
Mysqlx::Crud::UpdateOperation Struct Reference

Public Types

enum  UpdateType {
  SET = 1 , ITEM_REMOVE = 2 , ITEM_SET = 3 , ITEM_REPLACE = 4 ,
  ITEM_MERGE = 5 , ARRAY_INSERT = 6 , ARRAY_APPEND = 7 , MERGE_PATCH = 8
}
 

Public Attributes

required Mysqlx::Expr::ColumnIdentifier source = 1
 specification of the value to be updated More...
 
required UpdateType operation = 2
 the type of operation to be performed More...
 
optional Mysqlx::Expr::Expr value = 3
 an expression to be computed as the new value for the operation More...
 

Member Enumeration Documentation

◆ UpdateType

Enumerator
SET 

only allowed for TABLE

ITEM_REMOVE 

no value (removes the identified path from a object or array)

ITEM_SET 

sets the new value on the identified path

ITEM_REPLACE 

replaces a value if the path exists

ITEM_MERGE 

source and value must be documents

ARRAY_INSERT 

insert the value in the array at the index identified in the source path

ARRAY_APPEND 

append the value on the array at the identified path

MERGE_PATCH 

merge JSON object value with the provided patch expression

Member Data Documentation

◆ operation

required UpdateType Mysqlx::Crud::UpdateOperation::operation = 2

the type of operation to be performed

◆ source

required Mysqlx::Expr::ColumnIdentifier Mysqlx::Crud::UpdateOperation::source = 1

specification of the value to be updated

  • if data_model is TABLE, a column name may be specified and also a document path, if the column has type JSON
  • if data_model is DOCUMENT, only document paths are allowed
Note
in both cases, schema and table must be not set

◆ value

optional Mysqlx::Expr::Expr Mysqlx::Crud::UpdateOperation::value = 3

an expression to be computed as the new value for the operation


The documentation for this struct was generated from the following file: