MySQL Shell API 8.0.40
Unified development interface for MySQL Products
Methods | List of all members
DocResult Class Reference

Allows traversing the DbDoc objects returned by a Collection.find operation. More...

Methods

Document fetch_one ()
 Retrieves the next DbDoc on the DocResult. More...
 
list fetch_all ()
 Returns a list of DbDoc objects which contains an element for every unread document. More...
 
- Methods inherited from BaseResult
int get_affected_items_count ()
 The the number of affected items for the last operation. More...
 
int get_warnings_count ()
 The number of warnings produced by the last statement execution. More...
 
int get_warning_count ()
 The number of warnings produced by the last statement execution. More...
 
list get_warnings ()
 Retrieves the warnings generated by the executed operation. More...
 
str get_execution_time ()
 Retrieves a string value indicating the execution time of the executed operation.
 

Additional Inherited Members

- Properties inherited from BaseResult
int affected_items_count
 Same as get_affected_items_count()
 
int warning_count
 Same as get_warning_count() More...
 
int warnings_count
 Same as get_warnings_count()
 
list warnings
 Same as get_warnings()
 
str execution_time
 Same as get_execution_time()
 

Detailed Description

Allows traversing the DbDoc objects returned by a Collection.find operation.

Member Function Documentation

◆ fetch_one()

Document fetch_one ( )

Retrieves the next DbDoc on the DocResult.

Returns
A DbDoc object representing the next Document in the result.

◆ fetch_all()

list fetch_all ( )

Returns a list of DbDoc objects which contains an element for every unread document.

Returns
A List of DbDoc objects.

If this function is called right after executing a query, it will return a DbDoc for every document on the resultset.

If fetchOne is called before this function, when this function is called it will return a DbDoc for each of the remaining documents on the resultset.