“Redis Nodejs” Kod odpowiedzi

Redis Nodejs

/* npm install redis */

const redis = require("redis");
const client = redis.createClient();

client.on("error", function(error) {
  console.error(error);
});

client.set("key", "value", redis.print);
client.get("key", redis.print);
joakimjohansson.se

NodeJS redis setex

async function upsert(table, data) {
  let key = table;
  if (data && data.id) {
    key = key + '_' + data.id;
  }

  client.setex(key, 10, JSON.stringify(data));
  return true;
}
Jeff Le

Odpowiedzi podobne do “Redis Nodejs”

Pytania podobne do “Redis Nodejs”

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu