@@ -53,7 +53,7 @@ resp, err = steinClient.Add("sheet1",
5353 " column_1" : " value_1" ,
5454 " column_2" : " value_2" ,
5555 })
56- // handle err adn do something with resp
56+ // handle err and do something with resp
5757...
5858```
5959
@@ -79,11 +79,45 @@ resp, err = steinClient.Add("sheet1", rows...)
7979// handle err then do something with resp
8080...
8181```
82+ ### Update
83+ #### Update single row
84+ ` Limit 1 ` indicate to update only the first row that match the ` Condition ` .
85+ ``` go
86+ ...
87+ resp , err := sc.Update (" Sheet1" , UpdateParams {
88+ Condition : map [string ]string {
89+ " column_1" : " if_has_this_value" ,
90+ },
91+ Set : map [string ]string {
92+ " column_2" : " then_update_this_colum_value" ,
93+ },
94+ Limit : 1 ,
95+ })
96+ // handle err and do something with resp
97+ ...
98+ ```
99+ #### Update with multiple condition
100+ All ` Condition ` will be translated to ` AND ` condition.
101+ ``` go
102+ ...
103+ resp , err := sc.Update (" Sheet1" , UpdateParams {
104+ Condition : map [string ]string {
105+ " column_1" : " if_has_this_value" ,
106+ " column_3" : " and_if_has_this_value" ,
107+ },
108+ Set : map [string ]string {
109+ " column_2" : " then_update_this_colum_value" ,
110+ },
111+ })
112+ // handle err and do something with resp
113+ ...
114+ ```
115+ > :warning : ** If ` Limit ` is not set, all rows those match the ` Condition ` will be updated.**
82116
83117## TODO
84118- [x] Read data (https://docs.steinhq.com/read-data )
85119- [x] Read data with conditions (https://docs.steinhq.com/search-data )
86120- [x] Add data (https://docs.steinhq.com/add-rows )
87- - [ ] Update data (https://docs.steinhq.com/update-rows )
121+ - [x ] Update data (https://docs.steinhq.com/update-rows )
88122- [ ] Delete data (https://docs.steinhq.com/delete-rows )
89123- [ ] Authentication (https://docs.steinhq.com/authentication )
0 commit comments