You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to get every single value from a special json #68
@gkorland
the purpose of doing this is we want to test some escape character of rejson.
so we want to get every single value of above json. and if test done, we could create a PR that convert RFC6901 style json path to rejson style json path. like PR67. and the above json could be a test case in that pr
changed the title [-]How to get every value from a specially json `json.set doc . '{"":"empty", "\\":"slash","\'":"quote","\n":"enter", "\"":"double quote", "\'\'":"quote quote", "\t":"tab", "/":"value"}'`[/-][+]How to get every single value from a specially json[/+]on Feb 25, 2022
If you encountered issues it seems like the issue above the source is a redis-cli parsing issue.
If you'll try to run it with one of Redis clients e.g. redis-py it works without issues.
String v = client.get("doc", String.class, Path.of(".[\"\\\\\"]"));
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: JSON Path error: path error: \n$.["\\"]\n^^^^^^^^\n
at redis.clients.jedis.Protocol.processError(Protocol.java:139)
at redis.clients.jedis.Protocol.process(Protocol.java:173)
at redis.clients.jedis.Protocol.read(Protocol.java:227)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:352)
at redis.clients.jedis.Connection.getBinaryBulkReply(Connection.java:289)
at redis.clients.jedis.Connection.getBulkReply(Connection.java:279)
at com.redislabs.modules.rejson.JReJSON.get(JReJSON.java:246)
at com.redislabs.modules.rejson.Main.main(Main.java:25)
and try String v = client.get("doc", String.class, Path.of(".[\"\\\"]"));
Exception in thread "main" redis.clients.jedis.exceptions.JedisDataException: JSON Path error: path error: \n$.["\"]\n^^^^^^^\n
at redis.clients.jedis.Protocol.processError(Protocol.java:139)
at redis.clients.jedis.Protocol.process(Protocol.java:173)
at redis.clients.jedis.Protocol.read(Protocol.java:227)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:352)
at redis.clients.jedis.Connection.getBinaryBulkReply(Connection.java:289)
at redis.clients.jedis.Connection.getBulkReply(Connection.java:279)
at com.redislabs.modules.rejson.JReJSON.get(JReJSON.java:246)
at com.redislabs.modules.rejson.Main.main(Main.java:25)
so I think it's not a redis-cli bug but a rejson module bug.
Activity
gkorland commentedon Feb 24, 2022
Did you try ?
leonchen83 commentedon Feb 25, 2022
@gkorland
the purpose of doing this is we want to test some
escape characterof rejson.so we want to get every single value of above json. and if test done, we could create a PR that convert RFC6901 style json path to
rejson stylejson path. like PR67. and the above json could be a test case in that pr[-]How to get every value from a specially json `json.set doc . '{"":"empty", "\\":"slash","\'":"quote","\n":"enter", "\"":"double quote", "\'\'":"quote quote", "\t":"tab", "/":"value"}'`[/-][+]How to get every single value from a specially json[/+][-]How to get every single value from a specially json[/-][+]How to get every single value from a special json[/+]gkorland commentedon Feb 27, 2022
I assume you're getting an error like that:
If you encountered issues it seems like the issue above the source is a
redis-cliparsing issue.If you'll try to run it with one of Redis clients e.g. redis-py it works without issues.
leonchen83 commentedon Feb 28, 2022
I try to use JRedisJson got the same error
and try
String v = client.get("doc", String.class, Path.of(".[\"\\\"]"));so I think it's not a
redis-clibug but a rejson module bug.