Skip to content

Commit

Permalink
modify api
Browse files Browse the repository at this point in the history
  • Loading branch information
ninvfeng committed Feb 8, 2018
1 parent acacbc3 commit 9c66a4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mongodb.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function page($page,$num=10){
}

//添加记录
public function add($arr){
public function insert($arr){
$bulk = new \MongoDB\Driver\BulkWrite;
$bulk->insert($arr);
return $this->mongodb->executeBulkWrite($this->db.'.'.$this->table, $bulk);
Expand All @@ -65,7 +65,7 @@ public function delete(){
}

//修改记录
public function save($data){
public function update($data){
$bulk = new \MongoDB\Driver\BulkWrite;
$bulk->update($this->filter,['$set' => $data],['multi' => false, 'upsert' => false]);
$writeConcern = new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY, 1000);
Expand Down

0 comments on commit 9c66a4c

Please sign in to comment.