Skip to content

Commit afaecba

Browse files
Slairmy丁少龙
andauthored
增加bulkWrite实际插入数据的数量 (#51)
* Update server.go * 修复bulkWrite异常 * 回退格式化的代码 Co-authored-by: 丁少龙 <dingshaolong@aipai.com>
1 parent a8fe6cf commit afaecba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/MongoClient/Type/BulkWriteResult.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ class BulkWriteResult implements Unserializable
3636
*/
3737
private $deletedCount;
3838

39+
/**
40+
* @var int
41+
*/
42+
private $insertedCount;
43+
3944
/**
4045
* @var array<ObjectId>
4146
*/
@@ -47,6 +52,7 @@ public function bsonUnserialize(array $data)
4752
$this->modifiedCount = $data['modifiedcount'];
4853
$this->upsertedCount = $data['upsertedcount'];
4954
$this->deletedCount = $data['deletedcount'];
55+
$this->insertedCount = $data['insertedcount'];
5056
$this->upsertedIds = (array) $data['upsertedids'];
5157
}
5258

@@ -74,4 +80,10 @@ public function getUpsertedIds(): array
7480
{
7581
return (array) $this->upsertedIds;
7682
}
83+
84+
public function getinsertedCount(): int
85+
{
86+
return $this->insertedCount;
87+
}
88+
7789
}

0 commit comments

Comments
 (0)