网友回复
通过设置inc来操作字段自增,代码如下:
<?php $bulk = new MongoDB\Driver\BulkWrite; $bulk->update( ['x' => 2], ['$set' => ['name' => 'bfw', 'url' => 'bfw.wiki'],'$inc'=>["age"=>1]], ['multi' => false, 'upsert' => true] ); //通过对age这个字段进行自增...
点击查看剩余70%
网友回复
通过设置inc来操作字段自增,代码如下:
<?php $bulk = new MongoDB\Driver\BulkWrite; $bulk->update( ['x' => 2], ['$set' => ['name' => 'bfw', 'url' => 'bfw.wiki'],'$inc'=>["age"=>1]], ['multi' => false, 'upsert' => true] ); //通过对age这个字段进行自增...
点击查看剩余70%