对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

MongoDB\ChangeStream::getCursorId()

MongoDB\ChangeStream::getCursorId()

返回change stream游标的 ID。

function getCursorId(): MongoDB\Driver\CursorId

MongoDB\ 驱动程序\CursorId对象。

此示例报告变更流的游标 ID。

<?php
$uri = 'mongodb://rs1.example.com,rs2.example.com/?replicaSet=myReplicaSet';
$collection = (new MongoDB\Client($uri))->test->inventory;
$changeStream = $collection->watch();
var_dump($changeStream->getCursorId());

而输出将类似如下所示:

object(MongoDB\Driver\CursorId)#5 (1) {
["id"]=>
int(8462642181784669708)
}