-
| node-redis experts, Does node-redis cluster client support Redis transactions? by redis transactions I mean support for redis commands MULTI/EXEC and WATCH across cluster nodes/shards | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            leibale
          
      
      
        Jan 21, 2023 
      
    
    Replies: 1 comment 3 replies
-
| Redis (the server) does not support cross-slot commands in the same transaction (even if the slots are currently in the same shard/node). If you want to make sure that a couple of keys are in the same slot, you can use "hash tags" // this will throw `CROSSSLOT` error
cluster.multi()
  .set('11')
  .set('12')
  .exec();
// this will work
cluster.multi()
  .set('{1}1')
  .set('{1}2')
  .exec(); | 
Beta Was this translation helpful? Give feedback.
                  
                    3 replies
                  
                
            
      Answer selected by
        kamkash
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Redis (the server) does not support cross-slot commands in the same transaction (even if the slots are currently in the same shard/node). If you want to make sure that a couple of keys are in the same slot, you can use "hash tags"