You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{message: "The positional operator did not find the match needed from the query.",…}
message: "The positional operator did not find the match needed from the query."
exception: "MongoDB\Driver\Exception\BulkWriteException"
file: "C:\host\iBBi-Website4.1\vendor\mongodb\mongodb\src\Operation\Update.php"
line: 179
trace: [{file: "C:\host\iBBi-Website4.1\vendor\mongodb\mongodb\src\Operation\Update.php", line: 179,…},…]
This discussion was converted from issue #1901 on September 02, 2020 05:26.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
i'm trying to run this query but it doesn't work when element not exist and its message is :
Query:
$result = $this->where('_id', $param['brandId'])->where('projects._id', $param['_id'])->update(["projects.$.thumb" => $param['thumb'] ], ['upsert' => true]);
Or
$result = $this->raw(function($collection) use($param){
return $collection->updateOne(['_id' => $param['brandId'] , "projects" => ['$elemMatch'=>["_id"=>$param['_id']] ] ],
['$set' => ["projects.$.thumb" => $param['thumb'] ]],[ 'upsert' => true ,"new" => true ]);
Message:
{message: "The positional operator did not find the match needed from the query.",…}
message: "The positional operator did not find the match needed from the query."
exception: "MongoDB\Driver\Exception\BulkWriteException"
file: "C:\host\iBBi-Website4.1\vendor\mongodb\mongodb\src\Operation\Update.php"
line: 179
trace: [{file: "C:\host\iBBi-Website4.1\vendor\mongodb\mongodb\src\Operation\Update.php", line: 179,…},…]
Beta Was this translation helpful? Give feedback.
All reactions