Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do you have any documentation on how to use each function of Redis in Node-red ? #61

Open
Poon2542 opened this issue Jul 7, 2023 · 1 comment

Comments

@Poon2542
Copy link

Poon2542 commented Jul 7, 2023

Hi i'm using your npm on node-red. It's really great !!! but i seem at a lost on how to use each function. for example what should i specify in msg.payload , msg.topic ??. if i want to find whether there is a key inside redis i use EXIST function with msg.topic = "Key";
then what about the other??

If you want more clarification you can tell me and i'll try to explain my problem.

@golfvert
Copy link
Contributor

golfvert commented Jul 9, 2023

I agree, fantastic tool, with "challenging" documentation. It is, at least for me, a try and error approach...
Here is a simple example for EXISTS. All requests follow the same pattern (almost!). Hope this helps.

[
    {
        "id": "b22fc76fde701da6",
        "type": "inject",
        "z": "23a4b7ed06023116",
        "name": "Set",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[\"key1\",true,\"EX\",10]",
        "payloadType": "jsonata",
        "x": 450,
        "y": 2920,
        "wires": [
            [
                "47089de4fc17527a"
            ]
        ]
    },
    {
        "id": "47089de4fc17527a",
        "type": "redis-command",
        "z": "23a4b7ed06023116",
        "server": "d664c31c10874038",
        "command": "SET",
        "name": "",
        "topic": "",
        "params": "[]",
        "paramsType": "json",
        "payloadType": "json",
        "block": false,
        "x": 580,
        "y": 2920,
        "wires": [
            [
                "a43f1ee4355fb31b"
            ]
        ]
    },
    {
        "id": "a43f1ee4355fb31b",
        "type": "debug",
        "z": "23a4b7ed06023116",
        "name": "debug 44",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 720,
        "y": 2920,
        "wires": []
    },
    {
        "id": "bc0685a74adeb6b9",
        "type": "inject",
        "z": "23a4b7ed06023116",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "key1",
        "payload": "[]",
        "payloadType": "str",
        "x": 430,
        "y": 3000,
        "wires": [
            [
                "a958b165fb0c45e0"
            ]
        ]
    },
    {
        "id": "a958b165fb0c45e0",
        "type": "redis-command",
        "z": "23a4b7ed06023116",
        "server": "d664c31c10874038",
        "command": "EXISTS",
        "name": "",
        "topic": "",
        "params": "[]",
        "paramsType": "json",
        "payloadType": "json",
        "block": false,
        "x": 570,
        "y": 3000,
        "wires": [
            [
                "1bd109f234bcf243"
            ]
        ]
    },
    {
        "id": "1bd109f234bcf243",
        "type": "debug",
        "z": "23a4b7ed06023116",
        "name": "debug 45",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 720,
        "y": 3000,
        "wires": []
    },
    {
        "id": "d664c31c10874038",
        "type": "redis-config",
        "name": "Redis",
        "options": "redis:6379",
        "cluster": false,
        "optionsType": "str"
    }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants