Skip to content

Commit

Permalink
增加bulkWrite实际插入数据的数量 (#51)
Browse files Browse the repository at this point in the history
* Update server.go

* 修复bulkWrite异常

* 回退格式化的代码

Co-authored-by: 丁少龙 <[email protected]>
  • Loading branch information
Slairmy and 丁少龙 authored Mar 4, 2022
1 parent a8fe6cf commit afaecba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/MongoClient/Type/BulkWriteResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ class BulkWriteResult implements Unserializable
*/
private $deletedCount;

/**
* @var int
*/
private $insertedCount;

/**
* @var array<ObjectId>
*/
Expand All @@ -47,6 +52,7 @@ public function bsonUnserialize(array $data)
$this->modifiedCount = $data['modifiedcount'];
$this->upsertedCount = $data['upsertedcount'];
$this->deletedCount = $data['deletedcount'];
$this->insertedCount = $data['insertedcount'];
$this->upsertedIds = (array) $data['upsertedids'];
}

Expand Down Expand Up @@ -74,4 +80,10 @@ public function getUpsertedIds(): array
{
return (array) $this->upsertedIds;
}

public function getinsertedCount(): int
{
return $this->insertedCount;
}

}

0 comments on commit afaecba

Please sign in to comment.