How can I filter a MongoDB entry to update it using updateOne on PHP?
one text
Solution:
Missing square bracket ]
in your updateOne
method:
if($_POST){
$update = $collection->updateOne(
['studentid'=> $_POST['studentid']],
[ '$set' => [ 'name' => 'Brunos on Astoria' ]]
);
}
Source