我尝试使用php输入重量和墨水字段以及相关数据。但这给出了“某些错误”错误消息。我想做的是要向选定的现有mongoDB文档中添加权重和墨水字段
$insRec = new MongoDB\Driver\BulkWrite;
$insRec->update(['id'=>new MongoDB\BSON\ObjectID($b['$oid'])],['$push' =>['ink' =>$ink, 'weight'=>$weight]], ['multi' => false, 'upsert' => false]);
$writeConcern = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 1000);
$result = $manager->executeBulkWrite('sampledb.style', $insRec, $writeConcern);
print_r($result);
if($result->getModifiedCount()){
echo "OK";
}else{
echo "Something Wrong";