Checks if the current position in the cursor is valid

- « MongoDB\Driver\Cursor::toArray

- MongoDB\Driver\CursorId »

- PHP Manual
- MongoDB\Driver\Cursor
- Checks if the current position in the cursor is valid

# MongoDB\Driver\Cursor::valid

(mongodb >=1.9.0)

MongoDB\Driver\Cursor::valid — Checks if the current position in the cursor is valid

### Description

public MongoDB\Driver\Cursor::valid(): bool

### Parameters

This function has no parameters.

### Return Values

`true` if the current cursor position is valid, `false` otherwise.

### See Also

- Iterator::valid() - Checks if current position is valid