AlibabaCloud.TairSDK 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AlibabaCloud.TairSDK --version 1.3.0
NuGet\Install-Package AlibabaCloud.TairSDK -Version 1.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AlibabaCloud.TairSDK" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AlibabaCloud.TairSDK --version 1.3.0
#r "nuget: AlibabaCloud.TairSDK, 1.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AlibabaCloud.TairSDK as a Cake Addin
#addin nuget:?package=AlibabaCloud.TairSDK&version=1.3.0

// Install AlibabaCloud.TairSDK as a Cake Tool
#tool nuget:?package=AlibabaCloud.TairSDK&version=1.3.0

Feature: TairSearch module support tft.msearch and tft.analyzer commands.

AlibabaCloud-CSharp-sdk

English | 简体中文

A client packaged based on StackExchange.Redis that operates Tair For Redis Modules.

  • TairString, is a string that contains s version number.(Open sourced)
  • TairHash, is a hash that allows you to specify the expiration time and verison number of a field.(Open sourced)
  • TairZset, allows you to sort data of the double type based on multiple dimensions. (Open sourced)
  • TairDoc, to perform create, read, update, and delete (CRUD) operations on JSON data. (Coming soon)
  • TairGis, allowing you to query points, linestrings, and polygons. (Coming soon)
  • TairBloom, is a Bloom filter that supports dynamic scaling. (Coming soon)
  • TairRoaring, is a more efficient and balanced type of compressed bitmaps recognized by the industry. (Coming soon)
  • TairSearch, is a full-text search module developed in-house based on Redis modules.(Coming soon)
  • TairCpc, is a data structure developed based on the compressed probability counting (CPC) sketch. (Coming soon)
  • TairTs, is a time series data structure that is developed on top of Redis modules. (Coming soon)

Example

Connection

private static readonly ConnectionMultiplexer connDC = ConnectionMultiplexer.Connect("localhost");
private readonly TairString tair = new(connDC, 0);

Use ConnectionMultiplexer.Connect to create a ConnectionMultiplexer instance. Connection can be passed a configuration string or a ConfigurationOptions object. Once a ConnectionMultiplexer instance is created, a redis database (whether standalone or clustered) can be accessed.

Next, create the corresponding Module object, and then access the database. In addition, redis supports multiple databases, so when new an object, specify the corresponding database through the second parameter. (Clusters do not support this feature)

Async

For StackExchange.Redis, use ExecuteAsync to return the result as Task<RedisResult> type, you can use the following methods to get the real result

var ret1 = tairStringAsync.exset("key", "value");
Console.WriteLine(ResultHelper.Long(ret1.Result));//output "OK"

.Result is used to get the result of Async execution, ResultHelper.Long is used to convert RedisResult to the result required by the user.

API

An example of TairString is as follows:

using System.Text;
using Alibaba.TairSDK.TairString;
using StackExchange.Redis;

namespace TestString
{
    public class Program
    {
        private static readonly ConnectionMultiplexer connDC = ConnectionMultiplexer.Connect("localhost:6379");
        private static readonly TairString tair = new(connDC, 0);
        
        static void Main(string[] args)
        {
            var bkey = Encoding.UTF8.GetBytes("bkey");
            var bvalue = Encoding.UTF8.GetBytes("bvalue");
            var key = "key";
            var value = "value";

            //string
            var ret = tair.exset(key, value);
            Console.WriteLine(ret);
            var result = tair.exget(key);
            Console.WriteLine(result.getValue());
            Console.WriteLine(result.getVersion());
            

            //binary
            ret = tair.exset(bkey, bvalue);
            Console.WriteLine(ret);
            var bresult = tair.exget(bkey);
            Console.WriteLine(Encoding.UTF8.GetString(bresult.getValue()));
            Console.WriteLine(bresult.getVersion());
        }
    } 

}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.0 201 3/4/2024
1.3.0 754 3/16/2023
1.1.0 808 9/2/2022
1.0.0 846 6/22/2022