Syntax error using high level redis bindings

im trying to store user data in a redis database. i have some code that basically amounts to this:

    fn set_user_info() {
        let mut con = Client::open("redis://127.0.0.1").unwrap().get_connection().unwrap();
        let u = User {
            name: "name".to_string(),
            hash: "hash".to_string(),
        };
        let v = HashSet::from([
            ("name", &u.name),
            ("hash", &u.hash),
        ]);

        con.set(&u.name, v).unwrap()
    }

but for some reason this fails on my machine with a syntax error from redis

An error was signalled by the server - ResponseError: syntax error

what am i doing wrong?

I think most likely, the RPC protocol used by the client (i.e. the binding library) is incompatible with the server, for instance, e.g. different versions perhaps.

I suggest check the documentation of the library to see what versions it claims to support.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.