==================================== MongoDB\\ChangeStream::getCursorId() ==================================== .. default-domain:: mongodb .. contents:: On this page :local: :backlinks: none :depth: 1 :class: singlecol Definition ---------- .. phpmethod:: MongoDB\\ChangeStream::getCursorId() Returns the change stream cursor's ID. .. code-block:: php function getCursorId(): MongoDB\Driver\CursorId Return Values ------------- A :php:`MongoDB\\Driver\\CursorId ` object. Examples -------- This example reports the cursor ID for a change stream. .. code-block:: php test->inventory; $changeStream = $collection->watch(); var_dump($changeStream->getCursorId()); The output would then resemble:: object(MongoDB\Driver\CursorId)#5 (1) { ["id"]=> int(8462642181784669708) } See Also -------- - :phpmethod:`MongoDB\\Client::watch()` - :phpmethod:`MongoDB\\Collection::watch()` - :phpmethod:`MongoDB\\Database::watch()` - :php:`MongoDB\\Driver\\CursorId ` - :php:`MongoDB\\Driver\\Cursor::getId() `