Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gson convert error #70

Open
cjdxhjj opened this issue Mar 14, 2022 · 2 comments
Open

gson convert error #70

cjdxhjj opened this issue Mar 14, 2022 · 2 comments

Comments

@cjdxhjj
Copy link

cjdxhjj commented Mar 14, 2022

my test data is here
{"uid":1806217,"app":"znt","device_id":"879ce681_d5c7_4bbe_ae48_1e0a11c3bce1","create_time":"2022-02-23 10:17:14"}

the uid attribute is long

i have tried jReJSON.get(key, String.class, new Path("$.uid")),

image
image

i tried the jReJSON.get(key, List.class, new Path("$.uid")), or jReJSON.get(key, Object.class, new Path("$.uid"))
the resp is List but the item type is Double. the data is 1806217.0

then i try the jReJSON.get(key, String.class, new Path(".uid")), and convert is to a long manual

when i get moew than one property,
image

i have to defined a class that contains $.app and $.uid member ?

i think gson convert is worthless, can you remove it or provide an no convert method ?

@sazzad16
Copy link
Collaborator

@cjdxhjj You are trying to use RedisJSON v2 patterns. JRedisJSON only supports RedisJSON v1.

You may consider using Jedis. To use RedisJSON v2 patterns there, you would have to use Path2.

@cjdxhjj
Copy link
Author

cjdxhjj commented Mar 14, 2022

@sazzad16 thanks your replay, i would glad to have a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants