Update redis.md

Signed-off-by: wxbty <38374721+wxbty@users.noreply.github.com>
This commit is contained in:
wxbty 2022-11-03 11:22:46 +08:00 committed by GitHub
parent 51d3a552c1
commit 19393252de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 9 deletions

View File

@ -66,10 +66,14 @@ The above example uses secrets as plain strings. It is recommended to use a secr
This component supports **output binding** with the following operations: This component supports **output binding** with the following operations:
- `create` - `create`
- `get`
- `delete`
### create
You can store a record in Redis using the `create` operation. This sets a key to hold a value. If the key already exists, the value is overwritten. You can store a record in Redis using the `create` operation. This sets a key to hold a value. If the key already exists, the value is overwritten.
### Request #### Request
```json ```json
{ {
@ -82,17 +86,16 @@ You can store a record in Redis using the `create` operation. This sets a key to
"Lorem": "Ipsum" "Lorem": "Ipsum"
} }
} }
```
### Response #### Response
An HTTP 204 (No Content) and empty body is returned if successful. An HTTP 204 (No Content) and empty body is returned if successful.
- `get` ### get
You can get a record in Redis using the `get` operation. This gets a key that was previously set. You can get a record in Redis using the `get` operation. This gets a key that was previously set.
### Request #### Request
```json ```json
{ {
@ -105,7 +108,7 @@ You can get a record in Redis using the `get` operation. This gets a key that wa
} }
``` ```
### Response #### Response
```json ```json
{ {
@ -116,11 +119,11 @@ You can get a record in Redis using the `get` operation. This gets a key that wa
} }
``` ```
- `delete` ### delete
You can delete a record in Redis using the `delete` operation. Returns success whether the key exists or not. You can delete a record in Redis using the `delete` operation. Returns success whether the key exists or not.
### Request #### Request
```json ```json
{ {
@ -131,7 +134,7 @@ You can delete a record in Redis using the `delete` operation. Returns success w
} }
``` ```
### Response #### Response
An HTTP 204 (No Content) and empty body is returned if successful. An HTTP 204 (No Content) and empty body is returned if successful.