void TestLinsert( void ) { try { CRedisClient redis; redis.connect("127.0.0.1", 6379); string mykey = "testList"; int64_t count = redis.linsert(mykey, BEFORE, "zhongwei", "hello"); std::cout << count << std::endl; } catch( RdException& e ) { std::cout << "Redis exception:" << e.what() << std::endl; } catch( Poco::Exception& e ) { std::cout << "Poco_exception:" << e.what() << std::endl; } }
void TestLinsert( void ) { try { CRedisClient redis; redis.connect("127.0.0.1", 6379); string mykey = "key"; int64_t count = redis.linsert(mykey, "before", "b", "hello"); // int64_t count=redis.linsert(mykey,"after","b","world"); std::cout << count << std::endl; } catch( RdException& e ) { std::cout << "Redis exception:" << e.what() << std::endl; } catch( Poco::Exception& e ) { std::cout << "Poco_exception:" << e.what() << std::endl; } }