mysqlx.DbDoc¶
- class mysqlx.DbDoc(value: str | Dict[str, Any])¶
 Bases:
objectRepresents a generic document in JSON format.
- Parameters:
 value (object) – The value can be a JSON string or a dict.
- Raises:
 ValueError – If
valuetype is not a basestring or dict.
- as_str() str¶
 Serialize
mysqlx.DbDocto a JSON formattedstr.- Returns:
 A JSON formatted
strrepresentation of the document.- Return type:
 str
New in version 8.0.16.
- copy(doc_id: str | None = None) DbDoc¶
 Returns a new copy of a
mysqlx.DbDocobject containing the doc_id provided. If doc_id is not provided, it will be removed from newmysqlx.DbDocobject.- Parameters:
 doc_id (Optional[str]) – Document ID
- Returns:
 A new instance of DbDoc containing the _id provided
- Return type:
 
- keys() KeysView[str]¶
 Returns the keys.
- Returns:
 The keys.
- Return type:
 list