Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
}
Source by www.codota.com #
 
PREVIOUS NEXT
Tagged: #nodejs #redis #setex
ADD COMMENT
Topic
Name
6+7 =