From 6761d7f6a2a1f34038303c0ce11ff77085b3bb0a Mon Sep 17 00:00:00 2001 From: PragmaTwice Date: Sat, 21 Oct 2023 20:43:53 +0900 Subject: [PATCH] Add type name of JSON in redis_metadata.h --- src/storage/redis_metadata.h | 4 ++-- tests/gocase/unit/type/json/json_test.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/storage/redis_metadata.h b/src/storage/redis_metadata.h index 8d6aac65073..423d83888d4 100644 --- a/src/storage/redis_metadata.h +++ b/src/storage/redis_metadata.h @@ -64,8 +64,8 @@ enum RedisCommand { kRedisCmdLMove, }; -const std::vector RedisTypeNames = {"none", "string", "hash", "list", "set", - "zset", "bitmap", "sortedint", "stream", "MBbloom--"}; +const std::vector 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"; diff --git a/tests/gocase/unit/type/json/json_test.go b/tests/gocase/unit/type/json/json_test.go index fe6a8787062..5325b18bfdd 100644 --- a/tests/gocase/unit/type/json/json_test.go +++ b/tests/gocase/unit/type/json/json_test.go @@ -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) {