Skip to content

Commit 45a4c10

Browse files
hbh112233abcliu21st
authored andcommitted
修复mongo游标查询问题
1. 修复->cursor()查询报cursor方法未找到的报错 2. getCursor方法应该调用connection->cursor($this), 如果调用getCursor会报参数缺少mongoQuery
1 parent 065539f commit 45a4c10

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/db/Mongo.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,16 @@ public function getPk()
536536
return $this->pk ?: $this->connection->getConfig('pk');
537537
}
538538

539+
/**
540+
* 执行查询但只返回Cursor对象
541+
*
542+
* @return Cursor
543+
*/
544+
public function cursor(): Cursor
545+
{
546+
return $this->getCursor();
547+
}
548+
539549
/**
540550
* 执行查询但只返回Cursor对象
541551
*
@@ -545,7 +555,7 @@ public function getCursor(): Cursor
545555
{
546556
$this->parseOptions();
547557

548-
return $this->connection->getCursor($this);
558+
return $this->connection->cursor($this);
549559
}
550560

551561
/**

0 commit comments

Comments
 (0)