Returns the current result's index within the cursor

- « MongoDB\Driver\Cursor::isDead

- MongoDB\Driver\Cursor::next »

- PHP Manual
- MongoDB\Driver\Cursor
- Returns the current result's index within the cursor

# MongoDB\Driver\Cursor::key

(mongodb >=1.9.0)

MongoDB\Driver\Cursor::key — Returns the current result's index within the cursor

### Description

public MongoDB\Driver\Cursor::key(): int

### Parameters

This function has no parameters.

### Return Values

The current result's numeric index within the cursor.

### See Also

- Iterator::key() - Return the key of the current element