示例#1
0
void TestLrem( void )
{
	try
	{
		CRedisClient redis;
		redis.connect("127.0.0.1", 6379);

        uint64_t num = redis.lrem("testList","yuhaiyang");
        std::cout << "num: " << num << 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;
	}
}
示例#2
0
void TestLrem( void )
{
	try
	{
		CRedisClient redis;
		redis.connect("127.0.0.1", 6379);
		string mykey = "key";

		uint64_t num = 3;
		int64_t count = redis.lrem(mykey, num, "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;
	}
}