Skip to content

Commit e39ccf2

Browse files
committed
Merge branch '4.0' of github.com:top-think/think-orm into 4.0
2 parents 820c07d + 45a4c10 commit e39ccf2

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/db/Mongo.php

Lines changed: 14 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
/**
@@ -637,6 +647,9 @@ public function chunk(int $count, callable $callback, $column = null, string $or
637647
[$alias, $key] = explode('.', $column);
638648
} else {
639649
$key = $column;
650+
if ($key == '_id' && $this->connection->getConfig('pk_convert_id')) {
651+
$key = 'id';
652+
}
640653
}
641654
}
642655

0 commit comments

Comments
 (0)