Skip to content

Commit

Permalink
Add type name of JSON in redis_metadata.h
Browse files Browse the repository at this point in the history
  • Loading branch information
PragmaTwice committed Oct 21, 2023
1 parent 968551d commit 6761d7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/storage/redis_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ enum RedisCommand {
kRedisCmdLMove,
};

const std::vector<std::string> RedisTypeNames = {"none", "string", "hash", "list", "set",
"zset", "bitmap", "sortedint", "stream", "MBbloom--"};
const std::vector<std::string> RedisTypeNames = {"none", "string", "hash", "list", "set", "zset",
"bitmap", "sortedint", "stream", "MBbloom--", "ReJSON-RL"};

constexpr const char *kErrMsgWrongType = "WRONGTYPE Operation against a key holding the wrong kind of value";
constexpr const char *kErrMsgKeyExpired = "the key was expired";
Expand Down
1 change: 1 addition & 0 deletions tests/gocase/unit/type/json/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestJson(t *testing.T) {
require.Equal(t, rdb.Do(ctx, "JSON.GET", "a", "$..x", "$..y").Val(), `{"$..x":[1,{"y":2}],"$..y":[{"x":{"y":2},"y":3},3,2]}`)

require.Equal(t, rdb.Do(ctx, "JSON.GET", "no-such-key").Val(), nil)
require.Equal(t, rdb.Type(ctx, "a"), "ReJSON-RL")
})

t.Run("JSON.GET with options", func(t *testing.T) {
Expand Down

0 comments on commit 6761d7f

Please sign in to comment.