Redis在SET中输入或换行

时间:2015-03-22 12:52:05

标签: redis newline enter

如何使用enter | new line在Redis中设置键,例如

SET newkey "Text begins here
and ends here on the new line"

1 个答案:

答案 0 :(得分:1)

您可以执行以下操作(例如使用Python):

In [1]: import redis

In [2]: r = redis.Redis()

In [3]: r.set('newkey', 'Text begins here\x0a\x0dand ends here on the new line')
Out[3]: True

In [4]: print r.get('newkey')
Text begins here
and ends here on the new line