Skip to content

Commit e62766a

Browse files
authored
Update README.md
1 parent 3152280 commit e62766a

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,19 @@ $list = $this->$mongodb->findPagination('article', 10, 0, ['author' => $author])
7575

7676
```php
7777
$where = ['_id' => '1'];
78-
$result = $this->$mongodb->fetchOne('test', $where);
78+
$result = $this->$mongodb->findOneId('test', $where);
7979
```
8080

8181
### 查询全部数据(_id自动转对象)
8282

8383
```php
8484
$where = ['_id' => '1'];
85-
$result = $this->$mongodb->fetchAll('test', $where);
85+
$result = $this->$mongodb->findAllId('test', $where);
8686
```
8787

8888
### 分页查询(_id自动转对象)
8989
```php
90-
$list = $this->$mongodb->fetchPagination('article', 10, 0, ['author' => $author]);
90+
$list = $this->$mongodb->findPaginationId('article', 10, 0, ['author' => $author]);
9191
```
9292

9393
### 插入一条数据
@@ -122,11 +122,35 @@ $updateData = [];
122122
$this->$mongodb->updateColumn('test', $where,$updateData); // 只更新数据满足$where的行的列信息中在$newObject中出现过的字段
123123
$this->$mongodb->updateRow('test',$where,$updateData);// 更新数据满足$where的行的信息成$newObject
124124
```
125+
126+
### 更新(_id自动转对象)
127+
```php
128+
$where = ['_id'=>'1112313423'];
129+
$updateData = [];
130+
131+
$this->$mongodb->updateColumnId('test', $where,$updateData); // 只更新数据满足$where的行的列信息中在$newObject中出现过的字段
132+
$this->$mongodb->updateRowId('test',$where,$updateData);// 更新数据满足$where的行的信息成$newObject
133+
```
134+
125135
### 删除
126136
```php
127137
$where = ['_id'=>'1112313423'];
128138
$all = true; // 为false只删除匹配的一条,true删除多条
129-
$this->$mongodb->delete('test',$where,$all);
139+
$this->$mongodb->deleteOne('test',$where,$all);
140+
```
141+
142+
### 批量删除
143+
```php
144+
$where = ['_id'=>'1112313423'];
145+
$all = true; // 为false只删除匹配的一条,true删除多条
146+
$this->$mongodb->deleteMany('test',$where,$all);
147+
```
148+
149+
### 删除(_id自动转对象)
150+
```php
151+
$where = ['_id'=>'1112313423'];
152+
$all = true; // 为false只删除匹配的一条,true删除多条
153+
$this->$mongodb->deleteOneId('test',$where,$all);
130154
```
131155

132156
### 统计

0 commit comments

Comments
 (0)