CMS.MERGE destination numKeys source [source ...] [ WEIGHTS weight [weight ...]]

Available in: Redis Stack

Time complexity: O(n) where n is the number of sketches

Merges several sketches into one sketch. All sketches must have identical width and depth. Weights can be used to multiply certain sketches. Default weight is 1.

Parameters:

  • dest: The name of destination sketch. Must be initialized.
  • numKeys: Number of sketches to be merged.
  • src: Names of source sketches to be merged.
  • weight: Multiple of each sketch. Default =1.

Return

[] otherwise.

Examples

redis> CMS.MERGE dest 2 test1 test2 WEIGHTS 1 3
OK