Merge pull request #3 from utopia-php/fix-driver-gen-objectid

Allows document _id to be generated on driver side for return
This commit is contained in:
Shmuel Fogel authored and GitHub committed 2022-10-18 17:08:01 +03:00
commit f143e8f696
2 files changed
+3 -1

No files matched your search

Generated
+1 -1
View File
@@ -2257,5 +2257,5 @@
"ext-mongodb": "*"
},
"platform-dev": [],
"plugin-api-version": "2.2.0"
"plugin-api-version": "2.3.0"
}
+2
View File
@@ -376,6 +376,8 @@ class MongoClient
$docObj->{$key} = $value;
}
$docObj->_id ??= new BSON\ObjectId();
$this->query(array_merge([
MongoCommand::INSERT => $collection,
'documents' => [$docObj],