Node-red-contrib-deduplication

Hello,
I'm working on deduplication node but its not working as it states, if anybody had worked on it please share the flow.
node-red-contrib-dedupulication-adv

I presume the spelling there is a mistype, but even spelling as one would expect I can't even find the node. Can you provide the link to it on npmjs, or some other link?


this is link for the node

ok, so not node-red-contrib-depulication-adv but node-red-contrib-dedupulicate-adv.

Can you post a simple mini-flow using inject nodes to inject messages showing it failing.

I don't know what you are trying to achieve but have you considered whether the standard RBE node will do what you want?

[{"id":"78978128.4b3f2","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"17d5d1c1.b4b4ae","type":"deduplicate","z":"78978128.4b3f2","name":"","expirypolicy":"keep","registryclass":"","noderole":"standalone","expiry":"5","x":356.57303619384766,"y":312.3818817138672,"wires":[["f1de7d18.dfa2"],["196c735c.9c556d"]]},{"id":"38de3741.26ab08","type":"inject","z":"78978128.4b3f2","name":"","topic":"","payload":"[1,2,2,1]","payloadType":"bin","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":147.57291412353516,"y":304.9583435058594,"wires":[["17d5d1c1.b4b4ae"]]},{"id":"f1de7d18.dfa2","type":"debug","z":"78978128.4b3f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":610.5832977294922,"y":271.527774810791,"wires":[]},{"id":"196c735c.9c556d","type":"debug","z":"78978128.4b3f2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":606.5729522705078,"y":357.5278091430664,"wires":[]}] 

this is this flow i had created

What are you expecting to see and what are you seeing?
By the way if you give your debug nodes names it is easier to identify the data in the debug window.

I don't want to see duplicate values like I'm injecting array of [1,2,2,1] so the output should be [1,2]

The node says it is for deduplicating messages - in other words, stopping a message passing through the node if it has already been seen.

Nowhere does it say it can be used to remove duplicate entries from an array.

I'm not aware of a node that can do what you are asking, so for now you could use a Function node with the code:

msg.payload = [... new Set(msg.payload)]
return msg;

This code puts all of the array values into a new Set object. It then converts the Set back to an array. As Sets cannot contain duplicate values, this automatically removes them for you.

1 Like

The message coming in is actually a Buffer not an array, so you will need to modify that slightly if you do actually want a Buffer, not an array.

with this thing it is working fine.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.