Allows document _id to be generated on driver side for return

This commit is contained in:
wess committed 2022-10-13 11:47:48 -04:00
1 parent d26afa40b5
commit cf5a3d2f63
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],