Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 249 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get values from Redis using keys which contains spaces?

#1
Using telnet I type in command line commands like this

get field with spaces
get "field with spaces"
get 'field with spaces'

And all this three return same error.

-ERR wrong number of arguments for 'get' command
Reply

#2
What version of redis are you using? It works fine for me on 2.2.2 using double quotes

root@this:~# redis-cli
redis> set "test space" hello
OK
redis> get "test space"
"hello"
redis> get 'test space'
(error) ERR wrong number of arguments for 'get' command
redis>
Reply

#3
get "field\ with\ spaces"

that worked for me.
Reply

#4
If you only have telnet (and not 'redis-cli'), then you need to use the Redis binary-safe unified protocol to use spaces in key names, for example:

telnet localhost 6379
*2
$3
GET
$17
field with spaces
hello (this is Redis answer if "field with spaces" contains value "hello")

Explanation:
*2 = Number of arguments (first arg is "GET" and second is "field with spaces")
$3 = length of first argument ("GET" contains 3 bytes)
$17 = length of second argument ("field with spaces" contains 17 bytes)

More information about Redis binary-safe protocol:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through