Ejemplo n.º 1
0
        /// <summary>
        /// 移除集合 key 中的一个或多个 member 元素
        /// </summary>
        /// <param name="key"></param>
        /// <param name="values"></param>
        /// <returns></returns>
        public int SRemove(string key, params string[] values)
        {
            var result = 0;

            int.TryParse(RedisConnection.DoBatchWithIDKeys(RequestType.SREM, key, values).Data, out result);
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除哈希表 key 中的一个或多个指定域,不存在的域将被忽略
        /// </summary>
        /// <param name="hid"></param>
        /// <param name="keys"></param>
        /// <returns></returns>
        public int HDel(string hid, params string[] keys)
        {
            var result = RedisConnection.DoBatchWithIDKeys(RequestType.HDEL, hid, keys);

            if (int.TryParse(result.Data, out int count))
            {
                return(count);
            }
            return(0);
        }
Ejemplo n.º 3
0
 public ResponseData HDel(string hid, string[] keys)
 {
     return(_cnn.DoBatchWithIDKeys(RequestType.HDEL, hid, keys));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 将一个或多个 member 元素加入到集合 key 当中,已经存在于集合的 member 元素将被忽略
 /// </summary>
 /// <param name="key"></param>
 /// <param name="value"></param>
 public void SAdd(string key, string[] value)
 {
     RedisConnection.DoBatchWithIDKeys(RequestType.SADD, key, value);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 从键里面返回所有给定位置元素的位置(经度和纬度)
 /// </summary>
 /// <param name="key"></param>
 /// <param name="memebers"></param>
 /// <returns></returns>
 public List <GeoNum> GeoPos(string key, params string[] memebers)
 {
     return(RedisConnection.DoBatchWithIDKeys(RequestType.GEOPOS, key, memebers).ToGeoNums());
 }