delta_trace_db.query.query_result¶
Classes
|
(en) This class stores the query results and additional information from the database. |
- class delta_trace_db.query.query_result.QueryResult(is_success: bool, target: str, type_: EnumQueryType, result: List[Dict[str, Any]], db_length: int, update_count: int, hit_count: int, error_message: str | None = None)¶
Bases:
QueryExecutionResult(en) This class stores the query results and additional information from the database.
(ja) DBへのクエリ結果や付加情報を格納したクラスです。
- Parameters:
is_success (bool) – A flag indicating whether the operation was successful. This also changes depending on the value of the optional argument mustAffectAtLeastOne when creating a query. When mustAffectAtLeastOne is true, if the number of operation targets is 0, it will be treated as an error and the value will be false. When false, the value will be true even if the number of updates is 0. In other cases, if an exception occurs internally, it will be treated as an error.
target (str) – The query target collection name in DB. This was introduced in version 5 of this class. If the server is running an earlier version, an empty string is substituted.
type (EnumQueryType) – The query type for this result. The query type at the time of submission is entered as is.
result (List[Dict[str, Any]]) –
The operation result data. Always a list of serialized Dict objects (JSON). Its meaning depends on [type]:
For “search”: The list contains matched objects.
For “add”: The list contains the added objects with serial keys.
For “update”: The list contains updated objects.
For “delete”: The list contains deleted objects.
Note: For add/update/delete, the list is only populated if the query option [return_data] is set to true.
db_length (int) – DB side item length. This is The total number of items in the collection.
update_count (int) – The total number of items add, updated or deleted. When issuing a removeCollection query, if the target collection already exists, the result will be 1. if a non-existent collection is specified the result will be 0.
hit_count (int) – The total number of items searched.
error_message (Optional[str]) – A message that is added only if an error occurs.
- class_name: str = 'QueryResult'¶
- clone() QueryResult¶
(en) Returns a deep copy of this object.
(ja) このオブジェクトのディープコピーを返します。
- convert(from_dict: Callable) List¶
(en) The search results will be retrieved as an array of the specified class.
(ja) 検索結果を指定クラスの配列で取得します。
- Parameters:
from_dict (Callable) – Passes a function to restore an object from a dictionary. If the target is a CloneableFile, this is equivalent to the from_dict method.
- classmethod from_dict(src: Dict[str, Any]) QueryResult¶
(en) Restore this object from the dictionary.
(ja) このオブジェクトを辞書から復元します。
- Parameters:
src (Dict[str, Any]) – A dictionary made with to_dict of this class.
- Returns:
復元されたオブジェクト
- Return type:
CloneableFile
- to_dict() Dict[str, Any]¶
(en) Convert the object to a dictionary. The returned dictionary can only contain primitive types, null, lists or maps with only primitive elements. If you want to include other classes, the target class should inherit from this class and chain calls to_dict.
(ja) このオブジェクトを辞書に変換します。 戻り値の辞書にはプリミティブ型かプリミティブ型要素のみのリスト またはマップ等、そしてNoneのみを含められます。 それ以外のクラスを含めたい場合、対象のクラスもこのクラスを継承し、 to_dictを連鎖的に呼び出すようにしてください。
- version: str = '6'¶