aembke / fred.rs

An async Redis client for Rust.
Apache License 2.0
384 stars 62 forks source link

[Bug] json_set is not working for string values #252

Closed ecyk closed 4 months ago

ecyk commented 4 months ago

Fred version - 9.0.3 Redis version - 7.2.4 Platform - linux Deployment type - centralized

Describe the bug The json_set function returns an error when the value is a string.

To Reproduce Steps to reproduce the behavior:

let _: () = client.json_set("foo", "$", json!("my string value"), None).await?;

Error: Redis Error - kind: Unknown, details: expected value at line 1 column 1

ecyk commented 4 months ago

nvm, the correct way is:

let _: () = client.json_set("foo", "$", serde_json::to_string("my string value")?, None).await?;