MySQL Shell API 8.0.38
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 fetchOne ()
 Retrieves the next DbDoc on the DocResult. More...
 
List fetchAll ()
 Returns a list of DbDoc objects which contains an element for every unread document. More...
 
- Methods inherited from BaseResult
Integer getAffectedItemsCount ()
 The the number of affected items for the last operation. More...
 
Integer getWarningsCount ()
 The number of warnings produced by the last statement execution. More...
 
Integer getWarningCount ()
 The number of warnings produced by the last statement execution. More...
 
List getWarnings ()
 Retrieves the warnings generated by the executed operation. More...
 
String getExecutionTime ()
 Retrieves a string value indicating the execution time of the executed operation.
 

Additional Inherited Members

- Properties inherited from BaseResult
Integer affectedItemsCount
 Same as getAffectedItemsCount()
 
Integer warningCount
 Same as getWarningCount() More...
 
Integer warningsCount
 Same as getWarningsCount()
 
List warnings
 Same as getWarnings()
 
String executionTime
 Same as getExecutionTime()
 

Detailed Description

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

Member Function Documentation

◆ fetchOne()

Document fetchOne ( )

Retrieves the next DbDoc on the DocResult.

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

◆ fetchAll()

List fetchAll ( )

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.