note 124169 added to mongodb-driver-manager.executebulkwrite

From: Date: Wed, 04 Sep 2019 17:29:53 +0000
Subject: note 124169 added to mongodb-driver-manager.executebulkwrite
Groups: php.notes 
Request: Send a blank email to php-notes+get-212096@lists.php.net to get a copy of this message
If you're trying to figure out how to insert just one object and NOT an array resulting in a bunch of unwanted [0]s in your schema, I'm sorry I cannot help you. I've scoured the SERPs and since MongoDB\Driver\BulkWrite only takes an array it appears there is literally no way to "insertOne" in PHP7, nor a way to pass JUST an object and NOT an array, which may mean you must use a different language or revert to shell commands :-\. There are several articles where people, apparently mistakenly, refer to "MongoDB\Driver\Client" but neither that nor "MongoDB\Driver\Collections" appear to exist at all. I'm devastated, but if this forces me to downgrade to PHP5 on a brand new project I'll just need to move to a more modern language. :-( After several hours of this torture I'm now going to spend another hour trying to figure out if I can compose an update query that will collapse the unnecessary array that is being stuck where an object (document) should be. Ug. I realize people using MongoDB have mostly fled PHP, but abandoning the few & loyal among us is really very sad as has been attested to by the unresolved stackoverflow laments that have been going on for years. ---- Server IP: 208.43.231.9 Probable Submitter: 82.199.157.54 (proxied: 206.168.44.218) ---- Manual Page -- http://php.net/manual/en/mongodb-driver-manager.executebulkwrite.php Edit -- https://master.php.net/note/edit/124169 Del: integrated -- https://master.php.net/note/delete/124169/integrated Del: useless -- https://master.php.net/note/delete/124169/useless Del: bad code -- https://master.php.net/note/delete/124169/bad+code Del: spam -- https://master.php.net/note/delete/124169/spam Del: non-english -- https://master.php.net/note/delete/124169/non-english Del: in docs -- https://master.php.net/note/delete/124169/in+docs Del: other reasons-- https://master.php.net/note/delete/124169 Reject -- https://master.php.net/note/reject/124169 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#212096) next »