MSet sets the given keys to their respective values
(ctx *Context, txn *db.Transaction)
| 140 | |
| 141 | // MSet sets the given keys to their respective values |
| 142 | func MSet(ctx *Context, txn *db.Transaction) (OnCommit, error) { |
| 143 | argc := len(ctx.Args) |
| 144 | args := ctx.Args |
| 145 | if argc%2 != 0 { |
| 146 | return nil, ErrMSet |
| 147 | } |
| 148 | for i := 2; i <= argc; i += 2 { |
| 149 | ctx.Args = args[i-2 : i] |
| 150 | if _, err := Set(ctx, txn); err != nil { |
| 151 | return nil, err |
| 152 | } |
| 153 | } |
| 154 | return SimpleString(ctx.Out, OK), nil |
| 155 | } |
| 156 | |
| 157 | // MSetNx et multiple keys to multiple values,only if none of the keys exist |
| 158 | //TODO bug |
nothing calls this directly
no test coverage detected