Skip to content

Commit

Permalink
don't overwrite _id key if already present
Browse files Browse the repository at this point in the history
  • Loading branch information
1ma committed Apr 23, 2019
1 parent 5eb3a8f commit 93ca56f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Xhgui/Saver/Mongo.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public function __construct(MongoCollection $collection)

public function save(array $data)
{
$data['_id'] = self::getLastProfilingId();
if (!isset($data['_id'])) {
$data['_id'] = self::getLastProfilingId();
}

if (isset($data['meta']['request_ts'])) {
$data['meta']['request_ts'] = new MongoDate($data['meta']['request_ts']['sec']);
Expand Down

0 comments on commit 93ca56f

Please sign in to comment.