V
V
Vadim2020-05-15 11:05:37
JavaScript
Vadim, 2020-05-15 11:05:37

Is it possible to store an array of bytes in Redis?

Good afternoon! Is it possible in Redis to store data as a byte array, under a key that is also a byte array?
Something like this:

const key= [...Buffer.from('my:redis:key')];
/*
[
  109, 121,  58, 107, 101,
  121,  58, 105, 110,  58,
   98, 121, 116, 101, 115
]
*/

const value= [...Buffer.from('value')]; // [ 118, 97, 108, 117, 101 ]

redisClient.set(key, value);


I work in AWS under NodeJS. Through the setex command, the audio file was saved as a Buffer, which was taken from S3, saved in its original form in which it came from S3, but the key was a string.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim, 2020-05-15
@Darseed

Converting the data to Buffer solved the issue.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question