-
Notifications
You must be signed in to change notification settings - Fork 0
/
del.js
41 lines (38 loc) · 964 Bytes
/
del.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const instance = require('./instance');
const redis = instance.redis;
const client = instance.client;
const platform = require('connect-platform');
platform.core.node({
path: '/redis/del',
public: false,
inputs: [
'key'
],
outputs: [],
controlOutputs: [
'done',
'error'
],
hints: {
node: 'Deletes the <span class="hl-blue">value</span> associated with the <span class="hl-blue">key</span>.',
inputs: {
key: 'The has key to be used for the get operation.'
},
controlOutputs: {
done: "Signals that the deletion has been successful",
error: 'An error was triggered during the send process.'
},
}
}, (inputs, output, control, error) => {
if (!redis) error(new Error('Redis not configured properly.'));
else {
client.del(inputs.key, function (err, res) {
if(err) {
control('error');
console.error(err);
return ;
}
control('done');
});
}
});