Redis lua scripts use

the lua script is simple:

 local current = redis.call("GET", KEYS[2])
 if current == ARGV[2]
   then redis.call("SET", KEYS[1], ARGV[1])
   return true
 end

 return false

here is the java code:

 public static void main(String[] args) {
    //
      ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("application-redis.xml");
      final RedisTemplate<String,String> redisTemplate = applicationContext.
              getBean("redisTemplate",RedisTemplate.class);

     
      DefaultRedisScript<Boolean> script=new DefaultRedisScript<>();
     
      ClassPathResource resource=new ClassPathResource("test11.lua");
      
      script.setScriptSource(new ResourceScriptSource(resource));
     
      script.setResultType(Boolean.class);

      List<String> keys=new ArrayList();

      keys.add("k10");

      keys.add("k11");


      Boolean result=redisTemplate.execute(script,keys,new String[]{"lala","lala"});

      System.out.println(result);
  }

Storage of data in redis:

Why do you always return false??

Mar.11,2021
The value of value in

redis needs to be added with ""

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38544-2c0e7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38544-2c0e7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?