JSON.SET is returning "ERR new objects must be created at the root"

Im trying to use redisjson and when i follow the examples explained in “RedisJSON | Redis”, I am getting the error “ERR new objects must be created at the root”.


What should I do to fix it?

If I do it without the “$” it is working.
Do you know why the “$” is used in the example?

It should work without any issue, which version of RedisJSON/Redis are you using?

This example works for me using docker:> JSON.SET num $ 0

What version of ReJSON module do you get when you run the command info modules?

The $ is the JSONPath to use - $ is the root path.

thanks a lot for your answers.
I have installed the last stack version and now it works!

1 Like