Mongolid\Cursor\Cursor::toArray PHP Method

toArray() public method

Convert the cursor instance to a full associative array.
public toArray ( ) : array
return array
    public function toArray() : array
    {
        foreach ($this->getCursor() as $document) {
            $result[] = $this->getConverter()->toDomainTypes((array) $document);
        }
        return $result ?? [];
    }