Skip to content

Commit 597f54a

Browse files
committed
Add PATCH support for incrementing
1 parent 5b468c7 commit 597f54a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,13 +630,13 @@ character to seperate the database from the table name. The databases 'mysql', '
630630

631631
## Atomic increment
632632

633-
Incrementing a numeric field of a record is done with the PATCH method.
634-
Decrementing can be done using a negative increment value.
635-
The call returns the rows affected.
633+
Incrementing a numeric field of a record is done with the PATCH method (non-numeric fields are ignored).
634+
Decrementing can be done using a negative increment value. The call returns the rows affected.
635+
To add 2 to the field 'visitors' in the 'events' table for record with primary key '1', execute:
636636

637637
```
638638
PATCH http://localhost/api.php/events/1
639-
visitors=1
639+
{"visitors":2}
640640
```
641641

642642
Output:
@@ -645,7 +645,7 @@ Output:
645645
1
646646
```
647647

648-
Note that non-numeric fields will not be affected.
648+
Note that multiple fields can be incremented and batch operations are supported (see: update/PUT).
649649

650650
## Binary data
651651

0 commit comments

Comments
 (0)