0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Node.js: Redis のデータを削除 (Delete)

Last updated at Posted at 2020-12-30

プログラム

redis_delete.js
#! /usr/local/bin/node
// ---------------------------------------------------------------
//	redis_delete.js
//
//					May/25/2023
//
// ---------------------------------------------------------------
'use strict'

const redis = require('redis')

// ---------------------------------------------------------------
async function delete_proc (options)
{
	var argv = options.argv
	const key_in=argv[2]
	console.log (key_in)

//	const redis = new IORedis()	

	const client = redis.createClient()

	await client.connect()

	await client.del(key_in)

	await client.disconnect()
	console.error ("*** 終了 ***")	
}

// ---------------------------------------------------------------
console.error ("*** 開始 ***")

delete_proc({ argv: process.argv })

// ---------------------------------------------------------------

実行コマンド

./redis_delete.js t1856

確認したバージョン

$ node --version
v20.2.0
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?