From 6d2397bd8c181d8e4bef5fa936184a72cc91f31c Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Wed, 6 Nov 2024 14:33:20 +0000 Subject: [PATCH 01/17] DOC-4543 split C# client page into subpages --- content/develop/connect/clients/dotnet.md | 252 ------------------ .../develop/connect/clients/dotnet/_index.md | 90 +++++++ .../develop/connect/clients/dotnet/connect.md | 148 ++++++++++ .../connect/clients/dotnet/queryjson.md | 74 +++++ 4 files changed, 312 insertions(+), 252 deletions(-) delete mode 100644 content/develop/connect/clients/dotnet.md create mode 100644 content/develop/connect/clients/dotnet/_index.md create mode 100644 content/develop/connect/clients/dotnet/connect.md create mode 100644 content/develop/connect/clients/dotnet/queryjson.md diff --git a/content/develop/connect/clients/dotnet.md b/content/develop/connect/clients/dotnet.md deleted file mode 100644 index e0fded85fc..0000000000 --- a/content/develop/connect/clients/dotnet.md +++ /dev/null @@ -1,252 +0,0 @@ ---- -categories: -- docs -- develop -- stack -- oss -- rs -- rc -- oss -- kubernetes -- clients -description: Connect your .NET application to a Redis database -linkTitle: C#/.NET -title: C#/.NET guide -weight: 2 ---- - -[NRedisStack](https://github.com/redis/NRedisStack) is the .NET client for Redis. -The sections below explain how to install `NRedisStack` and connect your application -to a Redis database. - -`NRedisStack` requires a running Redis or [Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation instructions. - -You can also access Redis with an object-mapping client interface. See -[Redis OM for .NET]({{< relref "/integrate/redisom-for-net" >}}) -for more information. - -## Install - -Using the `dotnet` CLI, run: - -```bash -dotnet add package NRedisStack -``` - -## Connect - -Connect to localhost on port 6379. - -```csharp -using NRedisStack; -using NRedisStack.RedisStackCommands; -using StackExchange.Redis; -//... -ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost"); -IDatabase db = redis.GetDatabase(); -``` - -Store and retrieve a simple string. - -```csharp -db.StringSet("foo", "bar"); -Console.WriteLine(db.StringGet("foo")); // prints bar -``` - -Store and retrieve a HashMap. - -```csharp -var hash = new HashEntry[] { - new HashEntry("name", "John"), - new HashEntry("surname", "Smith"), - new HashEntry("company", "Redis"), - new HashEntry("age", "29"), - }; -db.HashSet("user-session:123", hash); - -var hashFields = db.HashGetAll("user-session:123"); -Console.WriteLine(String.Join("; ", hashFields)); -// Prints: -// name: John; surname: Smith; company: Redis; age: 29 -``` - -To access Redis Stack capabilities, use the appropriate interface like this: - -``` -IBloomCommands bf = db.BF(); -ICuckooCommands cf = db.CF(); -ICmsCommands cms = db.CMS(); -IGraphCommands graph = db.GRAPH(); -ITopKCommands topk = db.TOPK(); -ITdigestCommands tdigest = db.TDIGEST(); -ISearchCommands ft = db.FT(); -IJsonCommands json = db.JSON(); -ITimeSeriesCommands ts = db.TS(); -``` - -## Connect to a Redis cluster - -To connect to a Redis cluster, you just need to specify one or all cluster endpoints in the client configuration: - -```csharp -ConfigurationOptions options = new ConfigurationOptions -{ - //list of available nodes of the cluster along with the endpoint port. - EndPoints = { - { "localhost", 16379 }, - { "localhost", 16380 }, - // ... - }, -}; - -ConnectionMultiplexer cluster = ConnectionMultiplexer.Connect(options); -IDatabase db = cluster.GetDatabase(); - -db.StringSet("foo", "bar"); -Console.WriteLine(db.StringGet("foo")); // prints bar -``` - -## Connect to your production Redis with TLS - -When you deploy your application, use TLS and follow the [Redis security]({{< relref "/operate/oss_and_stack/management/security/" >}}) guidelines. - -Before connecting your application to the TLS-enabled Redis server, ensure that your certificates and private keys are in the correct format. - -To convert user certificate and private key from the PEM format to `pfx`, use this command: - -```bash -openssl pkcs12 -inkey redis_user_private.key -in redis_user.crt -export -out redis.pfx -``` - -Enter password to protect your `pfx` file. - -Establish a secure connection with your Redis database using this snippet. - -```csharp -ConfigurationOptions options = new ConfigurationOptions -{ - EndPoints = { { "my-redis.cloud.redislabs.com", 6379 } }, - User = "default", // use your Redis user. More info https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/ - Password = "secret", // use your Redis password - Ssl = true, - SslProtocols = System.Security.Authentication.SslProtocols.Tls12 -}; - -options.CertificateSelection += delegate -{ - return new X509Certificate2("redis.pfx", "secret"); // use the password you specified for pfx file -}; -options.CertificateValidation += ValidateServerCertificate; - -bool ValidateServerCertificate( - object sender, - X509Certificate? certificate, - X509Chain? chain, - SslPolicyErrors sslPolicyErrors) -{ - if (certificate == null) { - return false; - } - - var ca = new X509Certificate2("redis_ca.pem"); - bool verdict = (certificate.Issuer == ca.Subject); - if (verdict) { - return true; - } - Console.WriteLine("Certificate error: {0}", sslPolicyErrors); - return false; -} - -ConnectionMultiplexer muxer = ConnectionMultiplexer.Connect(options); - -//Creation of the connection to the DB -IDatabase conn = muxer.GetDatabase(); - -//send SET command -conn.StringSet("foo", "bar"); - -//send GET command and print the value -Console.WriteLine(conn.StringGet("foo")); -``` - -## Multiplexing - -Although example code typically works with a single connection, -real-world code often uses multiple connections at the same time. -Opening and closing connections repeatedly is inefficient, so it is best -to manage open connections carefully to avoid this. - -Several other -Redis client libraries use *connection pools* to reuse a set of open -connections efficiently. NRedisStack uses a different approach called -*multiplexing*, which sends all client commands and responses over a -single connection. NRedisStack manages multiplexing for you automatically. -This gives high performance without requiring any extra coding. -See -[Connection pools and multiplexing]({{< relref "/develop/connect/clients/pools-and-muxing" >}}) -for more information. - -## Example: Indexing and querying JSON documents - -This example shows how to create a -[search index]({{< relref "/develop/interact/search-and-query/indexing" >}}) -for [JSON]({{< relref "/develop/data-types/json" >}}) data and -run queries against the index. - -Make sure that you have Redis Stack and `NRedisStack` installed. - -Start by importing dependencies: - -{{< clients-example cs_home_json import >}} -{{< /clients-example >}} - -Connect to the database: - -{{< clients-example cs_home_json connect >}} -{{< /clients-example >}} - -Create some test data to add to the database: - -{{< clients-example cs_home_json create_data >}} -{{< /clients-example >}} - -Create an index. In this example, only JSON documents with the key prefix `user:` are indexed. For more information, see [Query syntax]({{< relref "/develop/interact/search-and-query/query/" >}}). - -{{< clients-example cs_home_json make_index >}} -{{< /clients-example >}} - -Add the three sets of user data to the database as -[JSON]({{< relref "/develop/data-types/json" >}}) objects. -If you use keys with the `user:` prefix then Redis will index the -objects automatically as you add them: - -{{< clients-example cs_home_json add_data >}} -{{< /clients-example >}} - -You can now use the index to search the JSON objects. The -[query]({{< relref "/develop/interact/search-and-query/query" >}}) -below searches for objects that have the text "Paul" in any field -and have an `age` value in the range 30 to 40: - -{{< clients-example cs_home_json query1 >}} -{{< /clients-example >}} - -Specify query options to return only the `city` field: - -{{< clients-example cs_home_json query2 >}} -{{< /clients-example >}} - -Use an -[aggregation query]({{< relref "/develop/interact/search-and-query/query/aggregation" >}}) -to count all users in each city. - -{{< clients-example cs_home_json query3 >}} -{{< /clients-example >}} - -See the [Redis query engine]({{< relref "/develop/interact/search-and-query" >}}) docs -for a full description of all query features with examples. - -## Learn more - -* [GitHub](https://github.com/redis/NRedisStack) - diff --git a/content/develop/connect/clients/dotnet/_index.md b/content/develop/connect/clients/dotnet/_index.md new file mode 100644 index 0000000000..5e234609f3 --- /dev/null +++ b/content/develop/connect/clients/dotnet/_index.md @@ -0,0 +1,90 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your .NET application to a Redis database +linkTitle: C#/.NET +title: C#/.NET guide +weight: 2 +--- + +[NRedisStack](https://github.com/redis/NRedisStack) is the .NET client for Redis. +The sections below explain how to install `NRedisStack` and connect your application +to a Redis database. + +`NRedisStack` requires a running Redis or [Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation instructions. + +You can also access Redis with an object-mapping client interface. See +[Redis OM for .NET]({{< relref "/integrate/redisom-for-net" >}}) +for more information. + +## Install + +Using the `dotnet` CLI, run: + +```bash +dotnet add package NRedisStack +``` + +## Connect and test + +Connect to localhost on port 6379. + +```csharp +using NRedisStack; +using NRedisStack.RedisStackCommands; +using StackExchange.Redis; +//... +ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost"); +IDatabase db = redis.GetDatabase(); +``` + +You can test the connection by storing and retrieving a simple string. + +```csharp +db.StringSet("foo", "bar"); +Console.WriteLine(db.StringGet("foo")); // prints bar +``` + +Store and retrieve a HashMap. + +```csharp +var hash = new HashEntry[] { + new HashEntry("name", "John"), + new HashEntry("surname", "Smith"), + new HashEntry("company", "Redis"), + new HashEntry("age", "29"), + }; +db.HashSet("user-session:123", hash); + +var hashFields = db.HashGetAll("user-session:123"); +Console.WriteLine(String.Join("; ", hashFields)); +// Prints: +// name: John; surname: Smith; company: Redis; age: 29 +``` +## Redis Stack modules + +To access Redis Stack capabilities, use the appropriate interface like this: + +``` +IBloomCommands bf = db.BF(); +ICuckooCommands cf = db.CF(); +ICmsCommands cms = db.CMS(); +IGraphCommands graph = db.GRAPH(); +ITopKCommands topk = db.TOPK(); +ITdigestCommands tdigest = db.TDIGEST(); +ISearchCommands ft = db.FT(); +IJsonCommands json = db.JSON(); +ITimeSeriesCommands ts = db.TS(); +``` + +## More information + +See the other pages in this section for more information and examples. diff --git a/content/develop/connect/clients/dotnet/connect.md b/content/develop/connect/clients/dotnet/connect.md new file mode 100644 index 0000000000..c1d8ab07c0 --- /dev/null +++ b/content/develop/connect/clients/dotnet/connect.md @@ -0,0 +1,148 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your .NET application to a Redis database +linkTitle: Connect +title: Connect to the server +weight: 2 +--- + +## Basic connection + +You can connect to the server simply by passing a string of the +form "hostname:port" to the `Connect()` method (for example, +"localhost:6379"). However, you can also connect using a +`ConfigurationOptions` parameter. Use this to specify a +username, password, and many other options: + +```csharp +using NRedisStack; +using NRedisStack.RedisStackCommands; +using StackExchange.Redis; + +ConfigurationOptions conf = new ConfigurationOptions { + EndPoints = { "localhost:6379" }, + User = "yourUsername", + Password = "yourPassword" +}; + +ConnectionMultiplexer redis = ConnectionMultiplexer.Connect(conf); +IDatabase db = redis.GetDatabase(); + +db.StringSet("foo", "bar"); +Console.WriteLine(db.StringGet("foo")); // prints bar +``` + +## Connect to a Redis cluster + +The basic connection will use the +[Cluster API]({{< relref "/operate/rs/clusters/optimize/oss-cluster-api" >}}) +if it is available without any special configuration. However, if you know +the addresses and ports of several cluster nodes, you can specify them all +during connection in the `Endpoints` parameter: + +```csharp +ConfigurationOptions options = new ConfigurationOptions +{ + //list of available nodes of the cluster along with the endpoint port. + EndPoints = { + { "localhost", 16379 }, + { "localhost", 16380 }, + // ... + }, +}; + +ConnectionMultiplexer cluster = ConnectionMultiplexer.Connect(options); +IDatabase db = cluster.GetDatabase(); + +db.StringSet("foo", "bar"); +Console.WriteLine(db.StringGet("foo")); // prints bar +``` + +## Connect to your production Redis with TLS + +When you deploy your application, use TLS and follow the [Redis security]({{< relref "/operate/oss_and_stack/management/security/" >}}) guidelines. + +Before connecting your application to the TLS-enabled Redis server, ensure that your certificates and private keys are in the correct format. + +To convert user certificate and private key from the PEM format to `pfx`, use this command: + +```bash +openssl pkcs12 -inkey redis_user_private.key -in redis_user.crt -export -out redis.pfx +``` + +Enter password to protect your `pfx` file. + +Establish a secure connection with your Redis database using this snippet. + +```csharp +ConfigurationOptions options = new ConfigurationOptions +{ + EndPoints = { { "my-redis.cloud.redislabs.com", 6379 } }, + User = "default", // use your Redis user. More info https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/ + Password = "secret", // use your Redis password + Ssl = true, + SslProtocols = System.Security.Authentication.SslProtocols.Tls12 +}; + +options.CertificateSelection += delegate +{ + return new X509Certificate2("redis.pfx", "secret"); // use the password you specified for pfx file +}; +options.CertificateValidation += ValidateServerCertificate; + +bool ValidateServerCertificate( + object sender, + X509Certificate? certificate, + X509Chain? chain, + SslPolicyErrors sslPolicyErrors) +{ + if (certificate == null) { + return false; + } + + var ca = new X509Certificate2("redis_ca.pem"); + bool verdict = (certificate.Issuer == ca.Subject); + if (verdict) { + return true; + } + Console.WriteLine("Certificate error: {0}", sslPolicyErrors); + return false; +} + +ConnectionMultiplexer muxer = ConnectionMultiplexer.Connect(options); + +//Creation of the connection to the DB +IDatabase conn = muxer.GetDatabase(); + +//send SET command +conn.StringSet("foo", "bar"); + +//send GET command and print the value +Console.WriteLine(conn.StringGet("foo")); +``` + +## Multiplexing + +Although example code typically works with a single connection, +real-world code often uses multiple connections at the same time. +Opening and closing connections repeatedly is inefficient, so it is best +to manage open connections carefully to avoid this. + +Several other +Redis client libraries use *connection pools* to reuse a set of open +connections efficiently. NRedisStack uses a different approach called +*multiplexing*, which sends all client commands and responses over a +single connection. NRedisStack manages multiplexing for you automatically. +This gives high performance without requiring any extra coding. +See +[Connection pools and multiplexing]({{< relref "/develop/connect/clients/pools-and-muxing" >}}) +for more information. diff --git a/content/develop/connect/clients/dotnet/queryjson.md b/content/develop/connect/clients/dotnet/queryjson.md new file mode 100644 index 0000000000..922291923f --- /dev/null +++ b/content/develop/connect/clients/dotnet/queryjson.md @@ -0,0 +1,74 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Learn how to use the Redis query engine with JSON +linkTitle: JSON query example +title: Example - Index and query JSON documents +weight: 2 +--- + +This example shows how to create a +[search index]({{< relref "/develop/interact/search-and-query/indexing" >}}) +for [JSON]({{< relref "/develop/data-types/json" >}}) data and +run queries against the index. + +Make sure that you have Redis Stack and `NRedisStack` installed. + +Start by importing dependencies: + +{{< clients-example cs_home_json import >}} +{{< /clients-example >}} + +Connect to the database: + +{{< clients-example cs_home_json connect >}} +{{< /clients-example >}} + +Create some test data to add to the database: + +{{< clients-example cs_home_json create_data >}} +{{< /clients-example >}} + +Create an index. In this example, only JSON documents with the key prefix `user:` are indexed. For more information, see [Query syntax]({{< relref "/develop/interact/search-and-query/query/" >}}). + +{{< clients-example cs_home_json make_index >}} +{{< /clients-example >}} + +Add the three sets of user data to the database as +[JSON]({{< relref "/develop/data-types/json" >}}) objects. +If you use keys with the `user:` prefix then Redis will index the +objects automatically as you add them: + +{{< clients-example cs_home_json add_data >}} +{{< /clients-example >}} + +You can now use the index to search the JSON objects. The +[query]({{< relref "/develop/interact/search-and-query/query" >}}) +below searches for objects that have the text "Paul" in any field +and have an `age` value in the range 30 to 40: + +{{< clients-example cs_home_json query1 >}} +{{< /clients-example >}} + +Specify query options to return only the `city` field: + +{{< clients-example cs_home_json query2 >}} +{{< /clients-example >}} + +Use an +[aggregation query]({{< relref "/develop/interact/search-and-query/query/aggregation" >}}) +to count all users in each city. + +{{< clients-example cs_home_json query3 >}} +{{< /clients-example >}} + +See the [Redis query engine]({{< relref "/develop/interact/search-and-query" >}}) docs +for a full description of all query features with examples. From 16918e9f1bdce666ce631c2a0ddcb127419d4c62 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Wed, 6 Nov 2024 17:06:52 +0000 Subject: [PATCH 02/17] DOC-4543 split Go client page and removed Connect folder level --- .../develop/{connect => }/clients/_index.md | 2 +- .../clients/client-side-caching.md | 0 .../{connect => }/clients/dotnet/_index.md | 0 .../{connect => }/clients/dotnet/connect.md | 0 .../{connect => }/clients/dotnet/queryjson.md | 0 content/develop/clients/go/_index.md | 193 +++++++ content/develop/clients/go/connect.md | 130 +++++ content/develop/clients/go/queryjson.md | 160 ++++++ .../{connect => }/clients/java/_index.md | 0 .../{connect => }/clients/java/jedis.md | 0 .../{connect => }/clients/java/lettuce.md | 0 .../develop/{connect => }/clients/nodejs.md | 0 .../clients/om-clients/_index.md | 0 content/develop/{connect => }/clients/php.md | 0 .../{connect => }/clients/pools-and-muxing.md | 0 .../{connect => }/clients/python/_index.md | 0 .../{connect => }/clients/python/redis-py.md | 0 .../{connect => }/clients/python/redis-vl.md | 0 content/develop/connect/_index.md | 47 -- content/develop/connect/clients/go.md | 526 ------------------ content/develop/tools/_index.md | 40 ++ content/develop/{connect => tools}/cli.md | 0 .../{connect => tools}/insight/_index.md | 0 .../{connect => tools}/insight/copilot-faq.md | 0 .../{connect => tools}/insight/debugging.md | 0 .../insight/images/Browser.png | Bin .../{connect => tools}/insight/images/CLI.png | Bin .../insight/images/Databases.png | Bin .../insight/images/Profiler.png | Bin .../insight/images/Workbench_Graph.png | Bin .../insight/images/Workbench_Search.png | Bin .../insight/images/Workbench_TimeSeries.png | Bin .../insight/images/bulk_actions.png | Bin .../insight/images/copilot-example.png | Bin .../insight/images/data_formatting.png | Bin .../insight/images/database_analysis.png | Bin .../insight/images/ico-redisinsight.svg | 0 .../insight/images/ri-rdi-add-endpoint1.png | Bin .../insight/images/ri-rdi-add-endpoint2.png | Bin .../insight/images/ri-rdi-endpoint-added.png | Bin .../images/ri-rdi-job-editor-template.png | Bin .../insight/images/ri-rdi-pl-dl.png | Bin .../insight/images/ri-rdi-pl-dryrun.png | Bin .../insight/images/ri-rdi-pl-editor-autoc.png | Bin .../insight/images/ri-rdi-pl-editor-dlg.png | Bin .../insight/images/ri-rdi-pl-editor-errs.png | Bin .../images/ri-rdi-pl-editor-minibuttons.png | Bin .../images/ri-rdi-pl-editor-sql-minie.png | Bin .../images/ri-rdi-pl-editor-template.png | Bin .../insight/images/ri-rdi-pl-start.png | Bin .../insight/images/ri-rdi-pl-test-cxn.png | Bin .../insight/images/ri-rdi-pl-unsaved.png | Bin .../insight/images/ri-rdi-stats-view.png | Bin .../insight/images/search.png | Bin .../insight/images/slowlog.png | Bin .../insight/images/streams.png | Bin .../insight/rdi-connector.md | 0 .../insight/release-notes/_index.md | 0 .../insight/release-notes/v.2.14.0.md | 0 .../insight/release-notes/v.2.16.0.md | 0 .../insight/release-notes/v.2.18.0.md | 0 .../insight/release-notes/v.2.20.0.md | 0 .../insight/release-notes/v.2.22.1.md | 0 .../insight/release-notes/v.2.24.0.md | 0 .../insight/release-notes/v.2.26.0.md | 0 .../insight/release-notes/v.2.30.0.md | 0 .../insight/release-notes/v.2.32.0.md | 0 .../insight/release-notes/v.2.34.0.md | 0 .../insight/release-notes/v.2.36.0.md | 0 .../insight/release-notes/v.2.38.0.md | 0 .../insight/release-notes/v.2.4.0.md | 0 .../insight/release-notes/v.2.40.0.md | 0 .../insight/release-notes/v.2.42.0.md | 0 .../insight/release-notes/v.2.44.0.md | 0 .../insight/release-notes/v.2.46.0.md | 0 .../insight/release-notes/v.2.48.0.md | 0 .../insight/release-notes/v.2.50.0.md | 0 .../insight/release-notes/v.2.52.0.md | 0 .../insight/release-notes/v.2.54.0.md | 0 .../insight/release-notes/v.2.56.0.md | 0 .../insight/release-notes/v.2.58.0.md | 0 .../insight/release-notes/v.2.6.0.md | 0 .../insight/release-notes/v.2.60.0.md | 0 .../insight/release-notes/v1.0.0.md | 0 .../insight/release-notes/v1.1.0.md | 0 .../insight/release-notes/v1.10.0.md | 0 .../insight/release-notes/v1.11.0.md | 0 .../insight/release-notes/v1.12.0.md | 0 .../insight/release-notes/v1.13.0.md | 0 .../insight/release-notes/v1.14.0.md | 0 .../insight/release-notes/v1.2.0.md | 0 .../insight/release-notes/v1.3.0.md | 0 .../insight/release-notes/v1.4.0.md | 0 .../insight/release-notes/v1.5.0.md | 0 .../insight/release-notes/v1.6.0.md | 0 .../insight/release-notes/v1.7.0.md | 0 .../insight/release-notes/v1.8.0.md | 0 .../insight/release-notes/v1.9.0.md | 0 .../insight/release-notes/v2.0.md | 0 .../insight/release-notes/v2.10.0.md | 0 .../insight/release-notes/v2.12.0.md | 0 .../insight/release-notes/v2.2.0.md | 0 .../insight/release-notes/v2.28.0.md | 0 .../insight/release-notes/v2.8.0.md | 0 .../insight/tutorials/images/consumer.png | Bin .../tutorials/images/insight_streams.png | Bin .../insight/tutorials/images/stream.png | Bin .../tutorials/insight-stream-consumer.md | 0 .../redis-for-vscode/_index.md | 0 .../redis-for-vscode/release-notes/_index.md | 0 .../redis-for-vscode/release-notes/v1.0.0.md | 0 111 files changed, 524 insertions(+), 574 deletions(-) rename content/develop/{connect => }/clients/_index.md (99%) rename content/develop/{connect => }/clients/client-side-caching.md (100%) rename content/develop/{connect => }/clients/dotnet/_index.md (100%) rename content/develop/{connect => }/clients/dotnet/connect.md (100%) rename content/develop/{connect => }/clients/dotnet/queryjson.md (100%) create mode 100644 content/develop/clients/go/_index.md create mode 100644 content/develop/clients/go/connect.md create mode 100644 content/develop/clients/go/queryjson.md rename content/develop/{connect => }/clients/java/_index.md (100%) rename content/develop/{connect => }/clients/java/jedis.md (100%) rename content/develop/{connect => }/clients/java/lettuce.md (100%) rename content/develop/{connect => }/clients/nodejs.md (100%) rename content/develop/{connect => }/clients/om-clients/_index.md (100%) rename content/develop/{connect => }/clients/php.md (100%) rename content/develop/{connect => }/clients/pools-and-muxing.md (100%) rename content/develop/{connect => }/clients/python/_index.md (100%) rename content/develop/{connect => }/clients/python/redis-py.md (100%) rename content/develop/{connect => }/clients/python/redis-vl.md (100%) delete mode 100644 content/develop/connect/_index.md delete mode 100644 content/develop/connect/clients/go.md create mode 100644 content/develop/tools/_index.md rename content/develop/{connect => tools}/cli.md (100%) rename content/develop/{connect => tools}/insight/_index.md (100%) rename content/develop/{connect => tools}/insight/copilot-faq.md (100%) rename content/develop/{connect => tools}/insight/debugging.md (100%) rename content/develop/{connect => tools}/insight/images/Browser.png (100%) rename content/develop/{connect => tools}/insight/images/CLI.png (100%) rename content/develop/{connect => tools}/insight/images/Databases.png (100%) rename content/develop/{connect => tools}/insight/images/Profiler.png (100%) rename content/develop/{connect => tools}/insight/images/Workbench_Graph.png (100%) rename content/develop/{connect => tools}/insight/images/Workbench_Search.png (100%) rename content/develop/{connect => tools}/insight/images/Workbench_TimeSeries.png (100%) rename content/develop/{connect => tools}/insight/images/bulk_actions.png (100%) rename content/develop/{connect => tools}/insight/images/copilot-example.png (100%) rename content/develop/{connect => tools}/insight/images/data_formatting.png (100%) rename content/develop/{connect => tools}/insight/images/database_analysis.png (100%) rename content/develop/{connect => tools}/insight/images/ico-redisinsight.svg (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-add-endpoint1.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-add-endpoint2.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-endpoint-added.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-job-editor-template.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-dl.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-dryrun.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-editor-autoc.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-editor-dlg.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-editor-errs.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-editor-minibuttons.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-editor-sql-minie.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-editor-template.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-start.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-test-cxn.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-pl-unsaved.png (100%) rename content/develop/{connect => tools}/insight/images/ri-rdi-stats-view.png (100%) rename content/develop/{connect => tools}/insight/images/search.png (100%) rename content/develop/{connect => tools}/insight/images/slowlog.png (100%) rename content/develop/{connect => tools}/insight/images/streams.png (100%) rename content/develop/{connect => tools}/insight/rdi-connector.md (100%) rename content/develop/{connect => tools}/insight/release-notes/_index.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.14.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.16.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.18.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.20.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.22.1.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.24.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.26.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.30.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.32.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.34.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.36.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.38.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.4.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.40.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.42.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.44.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.46.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.48.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.50.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.52.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.54.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.56.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.58.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.6.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v.2.60.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.0.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.1.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.10.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.11.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.12.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.13.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.14.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.2.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.3.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.4.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.5.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.6.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.7.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.8.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v1.9.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v2.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v2.10.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v2.12.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v2.2.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v2.28.0.md (100%) rename content/develop/{connect => tools}/insight/release-notes/v2.8.0.md (100%) rename content/develop/{connect => tools}/insight/tutorials/images/consumer.png (100%) rename content/develop/{connect => tools}/insight/tutorials/images/insight_streams.png (100%) rename content/develop/{connect => tools}/insight/tutorials/images/stream.png (100%) rename content/develop/{connect => tools}/insight/tutorials/insight-stream-consumer.md (100%) rename content/develop/{connect => tools}/redis-for-vscode/_index.md (100%) rename content/develop/{connect => tools}/redis-for-vscode/release-notes/_index.md (100%) rename content/develop/{connect => tools}/redis-for-vscode/release-notes/v1.0.0.md (100%) diff --git a/content/develop/connect/clients/_index.md b/content/develop/clients/_index.md similarity index 99% rename from content/develop/connect/clients/_index.md rename to content/develop/clients/_index.md index 33b61ec26a..ab60d7ea8f 100644 --- a/content/develop/connect/clients/_index.md +++ b/content/develop/clients/_index.md @@ -12,7 +12,7 @@ categories: description: Connect your application to a Redis database and try an example linkTitle: Clients title: Connect with Redis clients -weight: 45 +weight: 30 --- Use the Redis client libraries to connect to Redis servers from diff --git a/content/develop/connect/clients/client-side-caching.md b/content/develop/clients/client-side-caching.md similarity index 100% rename from content/develop/connect/clients/client-side-caching.md rename to content/develop/clients/client-side-caching.md diff --git a/content/develop/connect/clients/dotnet/_index.md b/content/develop/clients/dotnet/_index.md similarity index 100% rename from content/develop/connect/clients/dotnet/_index.md rename to content/develop/clients/dotnet/_index.md diff --git a/content/develop/connect/clients/dotnet/connect.md b/content/develop/clients/dotnet/connect.md similarity index 100% rename from content/develop/connect/clients/dotnet/connect.md rename to content/develop/clients/dotnet/connect.md diff --git a/content/develop/connect/clients/dotnet/queryjson.md b/content/develop/clients/dotnet/queryjson.md similarity index 100% rename from content/develop/connect/clients/dotnet/queryjson.md rename to content/develop/clients/dotnet/queryjson.md diff --git a/content/develop/clients/go/_index.md b/content/develop/clients/go/_index.md new file mode 100644 index 0000000000..8cb728220b --- /dev/null +++ b/content/develop/clients/go/_index.md @@ -0,0 +1,193 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your Go application to a Redis database +linkTitle: Go +title: Go guide +weight: 5 +--- + +[`go-redis`](https://github.com/redis/go-redis) is the [Go](https://go.dev/) client for Redis. +The sections below explain how to install `go-redis` and connect your application to a Redis database. + +`go-redis` requires a running Redis or +[Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. +See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation +instructions. + +## Install + +`go-redis` supports the last two Go versions. You can only use it from within +a Go module, so you must initialize a Go module before you start, or add your code to +an existing module: + +``` +go mod init github.com/my/repo +``` + +Use the `go get` command to install `go-redis/v9`: + +``` +go get github.com/redis/go-redis/v9 +``` + +## Connect + +The following example shows the simplest way to connect to a Redis server: + +```go +import ( + "context" + "fmt" + "github.com/redis/go-redis/v9" +) + +func main() { + client := redis.NewClient(&redis.Options{ + Addr: "localhost:6379", + Password: "", // No password set + DB: 0, // Use default DB + Protocol: 2, // Connection protocol + }) +} +``` + +You can also connect using a connection string: + +```go +opt, err := redis.ParseURL("redis://:@localhost:6379/") +if err != nil { + panic(err) +} + +client := redis.NewClient(opt) +``` + +After connecting, you can test the connection by storing and retrieving +a simple [string]({{< relref "/develop/data-types/strings" >}}): + +```go +ctx := context.Background() + +err := client.Set(ctx, "foo", "bar", 0).Err() +if err != nil { + panic(err) +} + +val, err := client.Get(ctx, "foo").Result() +if err != nil { + panic(err) +} +fmt.Println("foo", val) +``` + +You can also easily store and retrieve a [hash]({{< relref "/develop/data-types/hashes" >}}): + +```go +hashFields := []string{ + "model", "Deimos", + "brand", "Ergonom", + "type", "Enduro bikes", + "price", "4972", +} + +res1, err := rdb.HSet(ctx, "bike:1", hashFields).Result() + +if err != nil { + panic(err) +} + +fmt.Println(res1) // >>> 4 + +res2, err := rdb.HGet(ctx, "bike:1", "model").Result() + +if err != nil { + panic(err) +} + +fmt.Println(res2) // >>> Deimos + +res3, err := rdb.HGet(ctx, "bike:1", "price").Result() + +if err != nil { + panic(err) +} + +fmt.Println(res3) // >>> 4972 + +res4, err := rdb.HGetAll(ctx, "bike:1").Result() + +if err != nil { + panic(err) +} + +fmt.Println(res4) +// >>> map[brand:Ergonom model:Deimos price:4972 type:Enduro bikes] + ``` + + Use + [struct tags](https://stackoverflow.com/questions/10858787/what-are-the-uses-for-struct-tags-in-go) + of the form `redis:""` with the `Scan()` method to parse fields from + a hash directly into corresponding struct fields: + + ```go +type BikeInfo struct { + Model string `redis:"model"` + Brand string `redis:"brand"` + Type string `redis:"type"` + Price int `redis:"price"` +} + +var res4a BikeInfo +err = rdb.HGetAll(ctx, "bike:1").Scan(&res4a) + +if err != nil { + panic(err) +} + +fmt.Printf("Model: %v, Brand: %v, Type: %v, Price: $%v\n", + res4a.Model, res4a.Brand, res4a.Type, res4a.Price) +// >>> Model: Deimos, Brand: Ergonom, Type: Enduro bikes, Price: $4972 + ``` + +## Observability + +`go-redis` supports [OpenTelemetry](https://opentelemetry.io/) instrumentation. +to monitor performance and trace the execution of Redis commands. +For example, the following code instruments Redis commands to collect traces, logs, and metrics: + +```go +import ( + "github.com/redis/go-redis/v9" + "github.com/redis/go-redis/extra/redisotel/v9" +) + +rdb := redis.NewClient(&redis.Options{...}) + +// Enable tracing instrumentation. +if err := redisotel.InstrumentTracing(rdb); err != nil { + panic(err) +} + +// Enable metrics instrumentation. +if err := redisotel.InstrumentMetrics(rdb); err != nil { + panic(err) +} +``` + +See the `go-redis` [GitHub repo](https://github.com/redis/go-redis/blob/master/example/otel/README.md). +for more OpenTelemetry examples. + +## More information + +See the other pages in this section for more information and examples. +Further examples are available at the [`go-redis`](https://redis.uptrace.dev/guide/) website +and the [GitHub repository](https://github.com/redis/go-redis). diff --git a/content/develop/clients/go/connect.md b/content/develop/clients/go/connect.md new file mode 100644 index 0000000000..a164cadf5e --- /dev/null +++ b/content/develop/clients/go/connect.md @@ -0,0 +1,130 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your Go application to a Redis database +linkTitle: Connect +title: Connect to the server +weight: 1 +--- + +## Basic connection + +## Connect + +The following example shows the simplest way to connect to a Redis server: + +```go +import ( + "context" + "fmt" + "github.com/redis/go-redis/v9" +) + +func main() { + client := redis.NewClient(&redis.Options{ + Addr: "localhost:6379", + Password: "", // No password set + DB: 0, // Use default DB + Protocol: 2, // Connection protocol + }) +} +``` + +You can also connect using a connection string: + +```go +opt, err := redis.ParseURL("redis://:@localhost:6379/") +if err != nil { + panic(err) +} + +client := redis.NewClient(opt) +``` + +After connecting, you can test the connection by storing and retrieving +a simple [string]({{< relref "/develop/data-types/strings" >}}): + +```go +ctx := context.Background() + +err := client.Set(ctx, "foo", "bar", 0).Err() +if err != nil { + panic(err) +} + +val, err := client.Get(ctx, "foo").Result() +if err != nil { + panic(err) +} +fmt.Println("foo", val) +``` + +## Connect to a Redis cluster + +To connect to a Redis cluster, use `NewClusterClient()`. You can specify +one or more cluster endpoints with the `Addrs` option: + +```go +client := redis.NewClusterClient(&redis.ClusterOptions{ + Addrs: []string{":16379", ":16380", ":16381", ":16382", ":16383", ":16384"}, + + // To route commands by latency or randomly, enable one of the following. + //RouteByLatency: true, + //RouteRandomly: true, +}) +``` + +## Connect to your production Redis with TLS + +When you deploy your application, use TLS and follow the +[Redis security]({{< relref "/operate/oss_and_stack/management/security/" >}}) guidelines. + +Establish a secure connection with your Redis database: + +```go +// Load client cert +cert, err := tls.LoadX509KeyPair("redis_user.crt", "redis_user_private.key") +if err != nil { + log.Fatal(err) +} + +// Load CA cert +caCert, err := os.ReadFile("redis_ca.pem") +if err != nil { + log.Fatal(err) +} +caCertPool := x509.NewCertPool() +caCertPool.AppendCertsFromPEM(caCert) + +client := redis.NewClient(&redis.Options{ + Addr: "my-redis.cloud.redislabs.com:6379", + Username: "default", // use your Redis user. More info https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/ + Password: "secret", // use your Redis password + TLSConfig: &tls.Config{ + MinVersion: tls.VersionTLS12, + Certificates: []tls.Certificate{cert}, + RootCAs: caCertPool, + }, +}) + +//send SET command +err = client.Set(ctx, "foo", "bar", 0).Err() +if err != nil { + panic(err) +} + +//send GET command and print the value +val, err := client.Get(ctx, "foo").Result() +if err != nil { + panic(err) +} +fmt.Println("foo", val) +``` diff --git a/content/develop/clients/go/queryjson.md b/content/develop/clients/go/queryjson.md new file mode 100644 index 0000000000..f648634aa6 --- /dev/null +++ b/content/develop/clients/go/queryjson.md @@ -0,0 +1,160 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Learn how to use the Redis query engine with JSON +linkTitle: JSON query example +title: Example - Index and query JSON documents +weight: 2 +--- +This example shows how to create a +[search index]({{< relref "/develop/interact/search-and-query/indexing" >}}) +for [JSON]({{< relref "/develop/data-types/json" >}}) data and +run queries against the index. + +Make sure that you have Redis Stack and `NRedisStack` installed. + +Start by connecting to the Redis server: + +```go +import ( + "context" + "fmt" + + "github.com/redis/go-redis/v9" +) + +func main() { + ctx := context.Background() + + rdb := redis.NewClient(&redis.Options{ + Addr: "localhost:6379", + Password: "", + DB: 0, + Protocol: 2, + }) + + // ... +} +``` + +Add some `map` objects to store in JSON format in the database: + +```go +user1 := map[string]interface{}{ + "name": "Paul John", + "email": "paul.john@example.com", + "age": 42, + "city": "London", +} + +user2 := map[string]interface{}{ + "name": "Eden Zamir", + "email": "eden.zamir@example.com", + "age": 29, + "city": "Tel Aviv", +} + +user3 := map[string]interface{}{ + "name": "Paul Zamir", + "email": "paul.zamir@example.com", + "age": 35, + "city": "Tel Aviv", +} +``` + +Use the code below to create a search index. The `FTCreateOptions` parameter enables +indexing only for JSON objects where the key has a `user:` prefix. +The +[schema]({{< relref "/develop/interact/search-and-query/indexing" >}}) +for the index has three fields for the user's name, age, and city. +The `FieldName` field of the `FieldSchema` struct specifies a +[JSON path]({{< relref "/develop/data-types/json/path" >}}) +that identifies which data field to index. Use the `As` struct field +to provide an alias for the JSON path expression. You can use +the alias in queries as a short and intuitive way to refer to the +expression, instead of typing it in full: + +```go +_, err := rdb.FTCreate( + ctx, + "idx:users", + // Options: + &redis.FTCreateOptions{ + OnJSON: true, + Prefix: []interface{}{"user:"}, + }, + // Index schema fields: + &redis.FieldSchema{ + FieldName: "$.name", + As: "name", + FieldType: redis.SearchFieldTypeText, + }, + &redis.FieldSchema{ + FieldName: "$.city", + As: "city", + FieldType: redis.SearchFieldTypeTag, + }, + &redis.FieldSchema{ + FieldName: "$.age", + As: "age", + FieldType: redis.SearchFieldTypeNumeric, + }, +).Result() + +if err != nil { + panic(err) +} +``` + +Add the three sets of user data to the database as +[JSON]({{< relref "/develop/data-types/json" >}}) objects. +If you use keys with the `user:` prefix then Redis will index the +objects automatically as you add them: + +```go +_, err = rdb.JSONSet(ctx, "user:1", "$", user1).Result() + +if err != nil { + panic(err) +} + +_, err = rdb.JSONSet(ctx, "user:2", "$", user2).Result() + +if err != nil { + panic(err) +} + +_, err = rdb.JSONSet(ctx, "user:3", "$", user3).Result() + +if err != nil { + panic(err) +} +``` + +You can now use the index to search the JSON objects. The +[query]({{< relref "/develop/interact/search-and-query/query" >}}) +below searches for objects that have the text "Paul" in any field +and have an `age` value in the range 30 to 40: + +```go +searchResult, err := rdb.FTSearch( + ctx, + "idx:users", + "Paul @age:[30 40]", +).Result() + +if err != nil { + panic(err) +} + +fmt.Println(searchResult) +// >>> {1 [{user:3 map[$:{"age":35,"city":"Tel Aviv"... +``` \ No newline at end of file diff --git a/content/develop/connect/clients/java/_index.md b/content/develop/clients/java/_index.md similarity index 100% rename from content/develop/connect/clients/java/_index.md rename to content/develop/clients/java/_index.md diff --git a/content/develop/connect/clients/java/jedis.md b/content/develop/clients/java/jedis.md similarity index 100% rename from content/develop/connect/clients/java/jedis.md rename to content/develop/clients/java/jedis.md diff --git a/content/develop/connect/clients/java/lettuce.md b/content/develop/clients/java/lettuce.md similarity index 100% rename from content/develop/connect/clients/java/lettuce.md rename to content/develop/clients/java/lettuce.md diff --git a/content/develop/connect/clients/nodejs.md b/content/develop/clients/nodejs.md similarity index 100% rename from content/develop/connect/clients/nodejs.md rename to content/develop/clients/nodejs.md diff --git a/content/develop/connect/clients/om-clients/_index.md b/content/develop/clients/om-clients/_index.md similarity index 100% rename from content/develop/connect/clients/om-clients/_index.md rename to content/develop/clients/om-clients/_index.md diff --git a/content/develop/connect/clients/php.md b/content/develop/clients/php.md similarity index 100% rename from content/develop/connect/clients/php.md rename to content/develop/clients/php.md diff --git a/content/develop/connect/clients/pools-and-muxing.md b/content/develop/clients/pools-and-muxing.md similarity index 100% rename from content/develop/connect/clients/pools-and-muxing.md rename to content/develop/clients/pools-and-muxing.md diff --git a/content/develop/connect/clients/python/_index.md b/content/develop/clients/python/_index.md similarity index 100% rename from content/develop/connect/clients/python/_index.md rename to content/develop/clients/python/_index.md diff --git a/content/develop/connect/clients/python/redis-py.md b/content/develop/clients/python/redis-py.md similarity index 100% rename from content/develop/connect/clients/python/redis-py.md rename to content/develop/clients/python/redis-py.md diff --git a/content/develop/connect/clients/python/redis-vl.md b/content/develop/clients/python/redis-vl.md similarity index 100% rename from content/develop/connect/clients/python/redis-vl.md rename to content/develop/clients/python/redis-vl.md diff --git a/content/develop/connect/_index.md b/content/develop/connect/_index.md deleted file mode 100644 index 12a49f7591..0000000000 --- a/content/develop/connect/_index.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -categories: -- docs -- develop -- stack -- oss -- rs -- rc -- oss -- kubernetes -- clients -description: Learn how to use user interfaces and client libraries -linkTitle: Connect -title: Connect to Redis -weight: 35 ---- - -You can connect to Redis in the following ways: - -* With the `redis-cli` command line tool -* Use Redis Insight as a graphical user interface -* Via a client library for your programming language - -## Redis command line interface - -The [Redis command line interface]({{< relref "/develop/connect/cli" >}}) (also known as `redis-cli`) is a terminal program that sends commands to and reads replies from the Redis server. It has the following two main modes: - -1. An interactive Read Eval Print Loop (REPL) mode where the user types Redis commands and receives replies. -2. A command mode where `redis-cli` is executed with additional arguments, and the reply is printed to the standard output. - -## Redis Insight - -[Redis Insight]({{< relref "/develop/connect/insight" >}}) combines a graphical user interface with Redis CLI to let you work with any Redis deployment. You can visually browse and interact with data, take advantage of diagnostic tools, learn by example, and much more. Best of all, Redis Insight is free. - -## Client libraries - -It's easy to connect your application to a Redis database. The official client libraries cover the following languages: - -- [Python]({{< relref "/develop/connect/clients/python" >}}) -- [C#/.NET]({{< relref "/develop/connect/clients/dotnet" >}}) -- [Node.js]({{< relref "/develop/connect/clients/nodejs" >}}) -- [Java]({{< relref "/develop/connect/clients/java" >}}) -- [Go]({{< relref "/develop/connect/clients/go" >}}) - - - -
diff --git a/content/develop/connect/clients/go.md b/content/develop/connect/clients/go.md deleted file mode 100644 index 9e65e4dac8..0000000000 --- a/content/develop/connect/clients/go.md +++ /dev/null @@ -1,526 +0,0 @@ ---- -categories: -- docs -- develop -- stack -- oss -- rs -- rc -- oss -- kubernetes -- clients -description: Connect your Go application to a Redis database -linkTitle: Go -title: Go guide -weight: 5 ---- - -[`go-redis`](https://github.com/redis/go-redis) is the [Go](https://go.dev/) client for Redis. -The sections below explain how to install `go-redis` and connect your application to a Redis database. - -`go-redis` requires a running Redis or -[Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. -See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation -instructions. - -## Install - -`go-redis` supports the last two Go versions. You can only use it from within -a Go module, so you must initialize a Go module before you start, or add your code to -an existing module: - -``` -go mod init github.com/my/repo -``` - -Use the `go get` command to install `go-redis/v9`: - -``` -go get github.com/redis/go-redis/v9 -``` - -## Connect - -The following example shows the simplest way to connect to a Redis server: - -```go -import ( - "context" - "fmt" - "github.com/redis/go-redis/v9" -) - -func main() { - client := redis.NewClient(&redis.Options{ - Addr: "localhost:6379", - Password: "", // No password set - DB: 0, // Use default DB - Protocol: 2, // Connection protocol - }) -} -``` - -You can also connect using a connection string: - -```go -opt, err := redis.ParseURL("redis://:@localhost:6379/") -if err != nil { - panic(err) -} - -client := redis.NewClient(opt) -``` - -After connecting, you can test the connection by storing and retrieving -a simple [string]({{< relref "/develop/data-types/strings" >}}): - -```go -ctx := context.Background() - -err := client.Set(ctx, "foo", "bar", 0).Err() -if err != nil { - panic(err) -} - -val, err := client.Get(ctx, "foo").Result() -if err != nil { - panic(err) -} -fmt.Println("foo", val) -``` - -You can also easily store and retrieve a [hash]({{< relref "/develop/data-types/hashes" >}}): - -```go -hashFields := []string{ - "model", "Deimos", - "brand", "Ergonom", - "type", "Enduro bikes", - "price", "4972", -} - -res1, err := rdb.HSet(ctx, "bike:1", hashFields).Result() - -if err != nil { - panic(err) -} - -fmt.Println(res1) // >>> 4 - -res2, err := rdb.HGet(ctx, "bike:1", "model").Result() - -if err != nil { - panic(err) -} - -fmt.Println(res2) // >>> Deimos - -res3, err := rdb.HGet(ctx, "bike:1", "price").Result() - -if err != nil { - panic(err) -} - -fmt.Println(res3) // >>> 4972 - -res4, err := rdb.HGetAll(ctx, "bike:1").Result() - -if err != nil { - panic(err) -} - -fmt.Println(res4) -// >>> map[brand:Ergonom model:Deimos price:4972 type:Enduro bikes] - ``` - - Use - [struct tags](https://stackoverflow.com/questions/10858787/what-are-the-uses-for-struct-tags-in-go) - of the form `redis:""` with the `Scan()` method to parse fields from - a hash directly into corresponding struct fields: - - ```go -type BikeInfo struct { - Model string `redis:"model"` - Brand string `redis:"brand"` - Type string `redis:"type"` - Price int `redis:"price"` -} - -var res4a BikeInfo -err = rdb.HGetAll(ctx, "bike:1").Scan(&res4a) - -if err != nil { - panic(err) -} - -fmt.Printf("Model: %v, Brand: %v, Type: %v, Price: $%v\n", - res4a.Model, res4a.Brand, res4a.Type, res4a.Price) -// >>> Model: Deimos, Brand: Ergonom, Type: Enduro bikes, Price: $4972 - ``` - -### Connect to a Redis cluster - -To connect to a Redis cluster, use `NewClusterClient()`. - -```go -client := redis.NewClusterClient(&redis.ClusterOptions{ - Addrs: []string{":16379", ":16380", ":16381", ":16382", ":16383", ":16384"}, - - // To route commands by latency or randomly, enable one of the following. - //RouteByLatency: true, - //RouteRandomly: true, -}) -``` - -### Connect to your production Redis with TLS - -When you deploy your application, use TLS and follow the -[Redis security]({{< relref "/operate/oss_and_stack/management/security/" >}}) guidelines. - -Establish a secure connection with your Redis database: - -```go -// Load client cert -cert, err := tls.LoadX509KeyPair("redis_user.crt", "redis_user_private.key") -if err != nil { - log.Fatal(err) -} - -// Load CA cert -caCert, err := os.ReadFile("redis_ca.pem") -if err != nil { - log.Fatal(err) -} -caCertPool := x509.NewCertPool() -caCertPool.AppendCertsFromPEM(caCert) - -client := redis.NewClient(&redis.Options{ - Addr: "my-redis.cloud.redislabs.com:6379", - Username: "default", // use your Redis user. More info https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/ - Password: "secret", // use your Redis password - TLSConfig: &tls.Config{ - MinVersion: tls.VersionTLS12, - Certificates: []tls.Certificate{cert}, - RootCAs: caCertPool, - }, -}) - -//send SET command -err = client.Set(ctx, "foo", "bar", 0).Err() -if err != nil { - panic(err) -} - -//send GET command and print the value -val, err := client.Get(ctx, "foo").Result() -if err != nil { - panic(err) -} -fmt.Println("foo", val) -``` - -## Example: Index and search JSON documents - -Start by connecting to the Redis server: - -```go -import ( - "context" - "fmt" - - "github.com/redis/go-redis/v9" -) - -func main() { - ctx := context.Background() - - rdb := redis.NewClient(&redis.Options{ - Addr: "localhost:6379", - Password: "", - DB: 0, - Protocol: 2, - }) - - // ... -} -``` - -Add some `map` objects to store in JSON format in the database: - -```go -user1 := map[string]interface{}{ - "name": "Paul John", - "email": "paul.john@example.com", - "age": 42, - "city": "London", -} - -user2 := map[string]interface{}{ - "name": "Eden Zamir", - "email": "eden.zamir@example.com", - "age": 29, - "city": "Tel Aviv", -} - -user3 := map[string]interface{}{ - "name": "Paul Zamir", - "email": "paul.zamir@example.com", - "age": 35, - "city": "Tel Aviv", -} -``` - -Use the code below to create a search index. The `FTCreateOptions` parameter enables -indexing only for JSON objects where the key has a `user:` prefix. -The -[schema]({{< relref "/develop/interact/search-and-query/indexing" >}}) -for the index has three fields for the user's name, age, and city. -The `FieldName` field of the `FieldSchema` struct specifies a -[JSON path]({{< relref "/develop/data-types/json/path" >}}) -that identifies which data field to index. Use the `As` struct field -to provide an alias for the JSON path expression. You can use -the alias in queries as a short and intuitive way to refer to the -expression, instead of typing it in full: - -```go -_, err := rdb.FTCreate( - ctx, - "idx:users", - // Options: - &redis.FTCreateOptions{ - OnJSON: true, - Prefix: []interface{}{"user:"}, - }, - // Index schema fields: - &redis.FieldSchema{ - FieldName: "$.name", - As: "name", - FieldType: redis.SearchFieldTypeText, - }, - &redis.FieldSchema{ - FieldName: "$.city", - As: "city", - FieldType: redis.SearchFieldTypeTag, - }, - &redis.FieldSchema{ - FieldName: "$.age", - As: "age", - FieldType: redis.SearchFieldTypeNumeric, - }, -).Result() - -if err != nil { - panic(err) -} -``` - -Add the three sets of user data to the database as -[JSON]({{< relref "/develop/data-types/json" >}}) objects. -If you use keys with the `user:` prefix then Redis will index the -objects automatically as you add them: - -```go -_, err = rdb.JSONSet(ctx, "user:1", "$", user1).Result() - -if err != nil { - panic(err) -} - -_, err = rdb.JSONSet(ctx, "user:2", "$", user2).Result() - -if err != nil { - panic(err) -} - -_, err = rdb.JSONSet(ctx, "user:3", "$", user3).Result() - -if err != nil { - panic(err) -} -``` - -You can now use the index to search the JSON objects. The -[query]({{< relref "/develop/interact/search-and-query/query" >}}) -below searches for objects that have the text "Paul" in any field -and have an `age` value in the range 30 to 40: - -```go -searchResult, err := rdb.FTSearch( - ctx, - "idx:users", - "Paul @age:[30 40]", -).Result() - -if err != nil { - panic(err) -} - -fmt.Println(searchResult) -// >>> {1 [{user:3 map[$:{"age":35,"city":"Tel Aviv"... -``` - -## Example: Index and search hash documents - -Start by connecting to the Redis server as before: - -```go -import ( - "context" - "fmt" - - "github.com/redis/go-redis/v9" -) - -func main() { - ctx := context.Background() - - rdb := redis.NewClient(&redis.Options{ - Addr: "localhost:6379", - Password: "", - DB: 0, - Protocol: 2, - }) - - // ... -} -``` - -In this example, the user objects will be stored as hashes in the database. Use a `string` -array in the form of name-value pairs to supply the data for the -hash fields: - -```go -user1 := []string{ - "name", "Paul John", - "email", "paul.john@example.com", - "age", "42", - "city", "London", -} - -user2 := []string{ - "name", "Eden Zamir", - "email", "eden.zamir@example.com", - "age", "29", - "city", "Tel Aviv", -} - -user3 := []string{ - "name", "Paul Zamir", - "email", "paul.zamir@example.com", - "age", "35", - "city", "Tel Aviv", -} -``` - -It is easier to create the index for hash objects than -for JSON objects. Use the `FTCreateOptions` parameter to enable -indexing only for hash objects, but specify the same `user:` prefix -as before. You don't need the `As:` field in the schema parameters -here because hash fields have simple identifiers. They have no -JSON path expression and don't require an alias: - -```go -_, err := rdb.FTCreate( - ctx, - "idx:users", - // Options: - &redis.FTCreateOptions{ - OnHash: true, - Prefix: []interface{}{"user:"}, - }, - // Index schema fields: - &redis.FieldSchema{ - FieldName: "name", - FieldType: redis.SearchFieldTypeText, - }, - &redis.FieldSchema{ - FieldName: "city", - FieldType: redis.SearchFieldTypeTag, - }, - &redis.FieldSchema{ - FieldName: "age", - FieldType: redis.SearchFieldTypeNumeric, - }, -).Result() - -if err != nil { - panic(err) -} -``` - -Add the user data arrays to the database as hash objects. Redis will -index the hashes automatically because their keys have the -`user:` prefix: - -```go -_, err = rdb.HSet(ctx, "user:1", user1).Result() - -if err != nil { - panic(err) -} - -_, err = rdb.HSet(ctx, "user:2", user2).Result() - -if err != nil { - panic(err) -} - -_, err = rdb.HSet(ctx, "user:2", user3).Result() - -if err != nil { - panic(err) -} -``` - -The hashes have a structure very much like the JSON objects -from the previous example, so you can search the database with the -same query as before: - -```go -searchResult, err := rdb.FTSearch( - ctx, - "idx:users", - "Paul @age:[30 40]", -).Result() - -if err != nil { - panic(err) -} - -fmt.Println(searchResult) -// >>> {1 [{user:2 map[age:35 city:Tel Aviv... -``` - -## Observability - -`go-redis` supports [OpenTelemetry](https://opentelemetry.io/) instrumentation. -to monitor performance and trace the execution of Redis commands. -For example, the following code instruments Redis commands to collect traces, logs, and metrics: - -```go -import ( - "github.com/redis/go-redis/v9" - "github.com/redis/go-redis/extra/redisotel/v9" -) - -rdb := redis.NewClient(&redis.Options{...}) - -// Enable tracing instrumentation. -if err := redisotel.InstrumentTracing(rdb); err != nil { - panic(err) -} - -// Enable metrics instrumentation. -if err := redisotel.InstrumentMetrics(rdb); err != nil { - panic(err) -} -``` - -See the `go-redis` [GitHub repo](https://github.com/redis/go-redis/blob/master/example/otel/README.md). -for more OpenTelemetry examples. - -### Learn more - -* [Documentation](https://redis.uptrace.dev/guide/) -* [GitHub](https://github.com/redis/go-redis) - diff --git a/content/develop/tools/_index.md b/content/develop/tools/_index.md new file mode 100644 index 0000000000..6e1ad5b2c2 --- /dev/null +++ b/content/develop/tools/_index.md @@ -0,0 +1,40 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Tools to interact with a Redis server +linkTitle: Tools +hideListLinks: true +title: Redis tools +weight: 25 +--- + +You can use several tools to connect to a Redis server, to +manage it and interact with the data: + +* The [`redis-cli`](#redis-command-line-interface-cli) command line tool +* [Redis Insight](#redis-insight) (a graphical user interface tool) +* The Redis VSCode extension + +## Redis command line interface (CLI) + +The [Redis command line interface]({{< relref "/develop/connect/cli" >}}) (also known as `redis-cli`) is a terminal program that sends commands to and reads replies from the Redis server. It has the following two main modes: + +1. An interactive Read Eval Print Loop (REPL) mode where the user types Redis commands and receives replies. +2. A command mode where `redis-cli` is executed with additional arguments, and the reply is printed to the standard output. + +## Redis Insight + +[Redis Insight]({{< relref "/develop/connect/insight" >}}) combines a graphical user interface with Redis CLI to let you work with any Redis deployment. You can visually browse and interact with data, take advantage of diagnostic tools, learn by example, and much more. Best of all, Redis Insight is free. + +## Redis VSCode extension + +[Redis for VS Code]({{< relref "/develop/tools/redis-for-vscode" >}}) +is an extension that allows you to connect to your Redis databases from within Microsoft Visual Studio Code. After connecting to a database, you can view, add, modify, and delete keys, and interact with your Redis databases using a Redis Insight like UI and also a built-in CLI interface. diff --git a/content/develop/connect/cli.md b/content/develop/tools/cli.md similarity index 100% rename from content/develop/connect/cli.md rename to content/develop/tools/cli.md diff --git a/content/develop/connect/insight/_index.md b/content/develop/tools/insight/_index.md similarity index 100% rename from content/develop/connect/insight/_index.md rename to content/develop/tools/insight/_index.md diff --git a/content/develop/connect/insight/copilot-faq.md b/content/develop/tools/insight/copilot-faq.md similarity index 100% rename from content/develop/connect/insight/copilot-faq.md rename to content/develop/tools/insight/copilot-faq.md diff --git a/content/develop/connect/insight/debugging.md b/content/develop/tools/insight/debugging.md similarity index 100% rename from content/develop/connect/insight/debugging.md rename to content/develop/tools/insight/debugging.md diff --git a/content/develop/connect/insight/images/Browser.png b/content/develop/tools/insight/images/Browser.png similarity index 100% rename from content/develop/connect/insight/images/Browser.png rename to content/develop/tools/insight/images/Browser.png diff --git a/content/develop/connect/insight/images/CLI.png b/content/develop/tools/insight/images/CLI.png similarity index 100% rename from content/develop/connect/insight/images/CLI.png rename to content/develop/tools/insight/images/CLI.png diff --git a/content/develop/connect/insight/images/Databases.png b/content/develop/tools/insight/images/Databases.png similarity index 100% rename from content/develop/connect/insight/images/Databases.png rename to content/develop/tools/insight/images/Databases.png diff --git a/content/develop/connect/insight/images/Profiler.png b/content/develop/tools/insight/images/Profiler.png similarity index 100% rename from content/develop/connect/insight/images/Profiler.png rename to content/develop/tools/insight/images/Profiler.png diff --git a/content/develop/connect/insight/images/Workbench_Graph.png b/content/develop/tools/insight/images/Workbench_Graph.png similarity index 100% rename from content/develop/connect/insight/images/Workbench_Graph.png rename to content/develop/tools/insight/images/Workbench_Graph.png diff --git a/content/develop/connect/insight/images/Workbench_Search.png b/content/develop/tools/insight/images/Workbench_Search.png similarity index 100% rename from content/develop/connect/insight/images/Workbench_Search.png rename to content/develop/tools/insight/images/Workbench_Search.png diff --git a/content/develop/connect/insight/images/Workbench_TimeSeries.png b/content/develop/tools/insight/images/Workbench_TimeSeries.png similarity index 100% rename from content/develop/connect/insight/images/Workbench_TimeSeries.png rename to content/develop/tools/insight/images/Workbench_TimeSeries.png diff --git a/content/develop/connect/insight/images/bulk_actions.png b/content/develop/tools/insight/images/bulk_actions.png similarity index 100% rename from content/develop/connect/insight/images/bulk_actions.png rename to content/develop/tools/insight/images/bulk_actions.png diff --git a/content/develop/connect/insight/images/copilot-example.png b/content/develop/tools/insight/images/copilot-example.png similarity index 100% rename from content/develop/connect/insight/images/copilot-example.png rename to content/develop/tools/insight/images/copilot-example.png diff --git a/content/develop/connect/insight/images/data_formatting.png b/content/develop/tools/insight/images/data_formatting.png similarity index 100% rename from content/develop/connect/insight/images/data_formatting.png rename to content/develop/tools/insight/images/data_formatting.png diff --git a/content/develop/connect/insight/images/database_analysis.png b/content/develop/tools/insight/images/database_analysis.png similarity index 100% rename from content/develop/connect/insight/images/database_analysis.png rename to content/develop/tools/insight/images/database_analysis.png diff --git a/content/develop/connect/insight/images/ico-redisinsight.svg b/content/develop/tools/insight/images/ico-redisinsight.svg similarity index 100% rename from content/develop/connect/insight/images/ico-redisinsight.svg rename to content/develop/tools/insight/images/ico-redisinsight.svg diff --git a/content/develop/connect/insight/images/ri-rdi-add-endpoint1.png b/content/develop/tools/insight/images/ri-rdi-add-endpoint1.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-add-endpoint1.png rename to content/develop/tools/insight/images/ri-rdi-add-endpoint1.png diff --git a/content/develop/connect/insight/images/ri-rdi-add-endpoint2.png b/content/develop/tools/insight/images/ri-rdi-add-endpoint2.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-add-endpoint2.png rename to content/develop/tools/insight/images/ri-rdi-add-endpoint2.png diff --git a/content/develop/connect/insight/images/ri-rdi-endpoint-added.png b/content/develop/tools/insight/images/ri-rdi-endpoint-added.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-endpoint-added.png rename to content/develop/tools/insight/images/ri-rdi-endpoint-added.png diff --git a/content/develop/connect/insight/images/ri-rdi-job-editor-template.png b/content/develop/tools/insight/images/ri-rdi-job-editor-template.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-job-editor-template.png rename to content/develop/tools/insight/images/ri-rdi-job-editor-template.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-dl.png b/content/develop/tools/insight/images/ri-rdi-pl-dl.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-dl.png rename to content/develop/tools/insight/images/ri-rdi-pl-dl.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-dryrun.png b/content/develop/tools/insight/images/ri-rdi-pl-dryrun.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-dryrun.png rename to content/develop/tools/insight/images/ri-rdi-pl-dryrun.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-editor-autoc.png b/content/develop/tools/insight/images/ri-rdi-pl-editor-autoc.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-editor-autoc.png rename to content/develop/tools/insight/images/ri-rdi-pl-editor-autoc.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-editor-dlg.png b/content/develop/tools/insight/images/ri-rdi-pl-editor-dlg.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-editor-dlg.png rename to content/develop/tools/insight/images/ri-rdi-pl-editor-dlg.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-editor-errs.png b/content/develop/tools/insight/images/ri-rdi-pl-editor-errs.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-editor-errs.png rename to content/develop/tools/insight/images/ri-rdi-pl-editor-errs.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-editor-minibuttons.png b/content/develop/tools/insight/images/ri-rdi-pl-editor-minibuttons.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-editor-minibuttons.png rename to content/develop/tools/insight/images/ri-rdi-pl-editor-minibuttons.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-editor-sql-minie.png b/content/develop/tools/insight/images/ri-rdi-pl-editor-sql-minie.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-editor-sql-minie.png rename to content/develop/tools/insight/images/ri-rdi-pl-editor-sql-minie.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-editor-template.png b/content/develop/tools/insight/images/ri-rdi-pl-editor-template.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-editor-template.png rename to content/develop/tools/insight/images/ri-rdi-pl-editor-template.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-start.png b/content/develop/tools/insight/images/ri-rdi-pl-start.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-start.png rename to content/develop/tools/insight/images/ri-rdi-pl-start.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-test-cxn.png b/content/develop/tools/insight/images/ri-rdi-pl-test-cxn.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-test-cxn.png rename to content/develop/tools/insight/images/ri-rdi-pl-test-cxn.png diff --git a/content/develop/connect/insight/images/ri-rdi-pl-unsaved.png b/content/develop/tools/insight/images/ri-rdi-pl-unsaved.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-pl-unsaved.png rename to content/develop/tools/insight/images/ri-rdi-pl-unsaved.png diff --git a/content/develop/connect/insight/images/ri-rdi-stats-view.png b/content/develop/tools/insight/images/ri-rdi-stats-view.png similarity index 100% rename from content/develop/connect/insight/images/ri-rdi-stats-view.png rename to content/develop/tools/insight/images/ri-rdi-stats-view.png diff --git a/content/develop/connect/insight/images/search.png b/content/develop/tools/insight/images/search.png similarity index 100% rename from content/develop/connect/insight/images/search.png rename to content/develop/tools/insight/images/search.png diff --git a/content/develop/connect/insight/images/slowlog.png b/content/develop/tools/insight/images/slowlog.png similarity index 100% rename from content/develop/connect/insight/images/slowlog.png rename to content/develop/tools/insight/images/slowlog.png diff --git a/content/develop/connect/insight/images/streams.png b/content/develop/tools/insight/images/streams.png similarity index 100% rename from content/develop/connect/insight/images/streams.png rename to content/develop/tools/insight/images/streams.png diff --git a/content/develop/connect/insight/rdi-connector.md b/content/develop/tools/insight/rdi-connector.md similarity index 100% rename from content/develop/connect/insight/rdi-connector.md rename to content/develop/tools/insight/rdi-connector.md diff --git a/content/develop/connect/insight/release-notes/_index.md b/content/develop/tools/insight/release-notes/_index.md similarity index 100% rename from content/develop/connect/insight/release-notes/_index.md rename to content/develop/tools/insight/release-notes/_index.md diff --git a/content/develop/connect/insight/release-notes/v.2.14.0.md b/content/develop/tools/insight/release-notes/v.2.14.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.14.0.md rename to content/develop/tools/insight/release-notes/v.2.14.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.16.0.md b/content/develop/tools/insight/release-notes/v.2.16.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.16.0.md rename to content/develop/tools/insight/release-notes/v.2.16.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.18.0.md b/content/develop/tools/insight/release-notes/v.2.18.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.18.0.md rename to content/develop/tools/insight/release-notes/v.2.18.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.20.0.md b/content/develop/tools/insight/release-notes/v.2.20.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.20.0.md rename to content/develop/tools/insight/release-notes/v.2.20.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.22.1.md b/content/develop/tools/insight/release-notes/v.2.22.1.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.22.1.md rename to content/develop/tools/insight/release-notes/v.2.22.1.md diff --git a/content/develop/connect/insight/release-notes/v.2.24.0.md b/content/develop/tools/insight/release-notes/v.2.24.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.24.0.md rename to content/develop/tools/insight/release-notes/v.2.24.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.26.0.md b/content/develop/tools/insight/release-notes/v.2.26.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.26.0.md rename to content/develop/tools/insight/release-notes/v.2.26.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.30.0.md b/content/develop/tools/insight/release-notes/v.2.30.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.30.0.md rename to content/develop/tools/insight/release-notes/v.2.30.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.32.0.md b/content/develop/tools/insight/release-notes/v.2.32.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.32.0.md rename to content/develop/tools/insight/release-notes/v.2.32.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.34.0.md b/content/develop/tools/insight/release-notes/v.2.34.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.34.0.md rename to content/develop/tools/insight/release-notes/v.2.34.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.36.0.md b/content/develop/tools/insight/release-notes/v.2.36.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.36.0.md rename to content/develop/tools/insight/release-notes/v.2.36.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.38.0.md b/content/develop/tools/insight/release-notes/v.2.38.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.38.0.md rename to content/develop/tools/insight/release-notes/v.2.38.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.4.0.md b/content/develop/tools/insight/release-notes/v.2.4.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.4.0.md rename to content/develop/tools/insight/release-notes/v.2.4.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.40.0.md b/content/develop/tools/insight/release-notes/v.2.40.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.40.0.md rename to content/develop/tools/insight/release-notes/v.2.40.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.42.0.md b/content/develop/tools/insight/release-notes/v.2.42.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.42.0.md rename to content/develop/tools/insight/release-notes/v.2.42.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.44.0.md b/content/develop/tools/insight/release-notes/v.2.44.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.44.0.md rename to content/develop/tools/insight/release-notes/v.2.44.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.46.0.md b/content/develop/tools/insight/release-notes/v.2.46.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.46.0.md rename to content/develop/tools/insight/release-notes/v.2.46.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.48.0.md b/content/develop/tools/insight/release-notes/v.2.48.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.48.0.md rename to content/develop/tools/insight/release-notes/v.2.48.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.50.0.md b/content/develop/tools/insight/release-notes/v.2.50.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.50.0.md rename to content/develop/tools/insight/release-notes/v.2.50.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.52.0.md b/content/develop/tools/insight/release-notes/v.2.52.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.52.0.md rename to content/develop/tools/insight/release-notes/v.2.52.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.54.0.md b/content/develop/tools/insight/release-notes/v.2.54.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.54.0.md rename to content/develop/tools/insight/release-notes/v.2.54.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.56.0.md b/content/develop/tools/insight/release-notes/v.2.56.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.56.0.md rename to content/develop/tools/insight/release-notes/v.2.56.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.58.0.md b/content/develop/tools/insight/release-notes/v.2.58.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.58.0.md rename to content/develop/tools/insight/release-notes/v.2.58.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.6.0.md b/content/develop/tools/insight/release-notes/v.2.6.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.6.0.md rename to content/develop/tools/insight/release-notes/v.2.6.0.md diff --git a/content/develop/connect/insight/release-notes/v.2.60.0.md b/content/develop/tools/insight/release-notes/v.2.60.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v.2.60.0.md rename to content/develop/tools/insight/release-notes/v.2.60.0.md diff --git a/content/develop/connect/insight/release-notes/v1.0.0.md b/content/develop/tools/insight/release-notes/v1.0.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.0.0.md rename to content/develop/tools/insight/release-notes/v1.0.0.md diff --git a/content/develop/connect/insight/release-notes/v1.1.0.md b/content/develop/tools/insight/release-notes/v1.1.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.1.0.md rename to content/develop/tools/insight/release-notes/v1.1.0.md diff --git a/content/develop/connect/insight/release-notes/v1.10.0.md b/content/develop/tools/insight/release-notes/v1.10.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.10.0.md rename to content/develop/tools/insight/release-notes/v1.10.0.md diff --git a/content/develop/connect/insight/release-notes/v1.11.0.md b/content/develop/tools/insight/release-notes/v1.11.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.11.0.md rename to content/develop/tools/insight/release-notes/v1.11.0.md diff --git a/content/develop/connect/insight/release-notes/v1.12.0.md b/content/develop/tools/insight/release-notes/v1.12.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.12.0.md rename to content/develop/tools/insight/release-notes/v1.12.0.md diff --git a/content/develop/connect/insight/release-notes/v1.13.0.md b/content/develop/tools/insight/release-notes/v1.13.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.13.0.md rename to content/develop/tools/insight/release-notes/v1.13.0.md diff --git a/content/develop/connect/insight/release-notes/v1.14.0.md b/content/develop/tools/insight/release-notes/v1.14.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.14.0.md rename to content/develop/tools/insight/release-notes/v1.14.0.md diff --git a/content/develop/connect/insight/release-notes/v1.2.0.md b/content/develop/tools/insight/release-notes/v1.2.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.2.0.md rename to content/develop/tools/insight/release-notes/v1.2.0.md diff --git a/content/develop/connect/insight/release-notes/v1.3.0.md b/content/develop/tools/insight/release-notes/v1.3.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.3.0.md rename to content/develop/tools/insight/release-notes/v1.3.0.md diff --git a/content/develop/connect/insight/release-notes/v1.4.0.md b/content/develop/tools/insight/release-notes/v1.4.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.4.0.md rename to content/develop/tools/insight/release-notes/v1.4.0.md diff --git a/content/develop/connect/insight/release-notes/v1.5.0.md b/content/develop/tools/insight/release-notes/v1.5.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.5.0.md rename to content/develop/tools/insight/release-notes/v1.5.0.md diff --git a/content/develop/connect/insight/release-notes/v1.6.0.md b/content/develop/tools/insight/release-notes/v1.6.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.6.0.md rename to content/develop/tools/insight/release-notes/v1.6.0.md diff --git a/content/develop/connect/insight/release-notes/v1.7.0.md b/content/develop/tools/insight/release-notes/v1.7.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.7.0.md rename to content/develop/tools/insight/release-notes/v1.7.0.md diff --git a/content/develop/connect/insight/release-notes/v1.8.0.md b/content/develop/tools/insight/release-notes/v1.8.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.8.0.md rename to content/develop/tools/insight/release-notes/v1.8.0.md diff --git a/content/develop/connect/insight/release-notes/v1.9.0.md b/content/develop/tools/insight/release-notes/v1.9.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v1.9.0.md rename to content/develop/tools/insight/release-notes/v1.9.0.md diff --git a/content/develop/connect/insight/release-notes/v2.0.md b/content/develop/tools/insight/release-notes/v2.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v2.0.md rename to content/develop/tools/insight/release-notes/v2.0.md diff --git a/content/develop/connect/insight/release-notes/v2.10.0.md b/content/develop/tools/insight/release-notes/v2.10.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v2.10.0.md rename to content/develop/tools/insight/release-notes/v2.10.0.md diff --git a/content/develop/connect/insight/release-notes/v2.12.0.md b/content/develop/tools/insight/release-notes/v2.12.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v2.12.0.md rename to content/develop/tools/insight/release-notes/v2.12.0.md diff --git a/content/develop/connect/insight/release-notes/v2.2.0.md b/content/develop/tools/insight/release-notes/v2.2.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v2.2.0.md rename to content/develop/tools/insight/release-notes/v2.2.0.md diff --git a/content/develop/connect/insight/release-notes/v2.28.0.md b/content/develop/tools/insight/release-notes/v2.28.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v2.28.0.md rename to content/develop/tools/insight/release-notes/v2.28.0.md diff --git a/content/develop/connect/insight/release-notes/v2.8.0.md b/content/develop/tools/insight/release-notes/v2.8.0.md similarity index 100% rename from content/develop/connect/insight/release-notes/v2.8.0.md rename to content/develop/tools/insight/release-notes/v2.8.0.md diff --git a/content/develop/connect/insight/tutorials/images/consumer.png b/content/develop/tools/insight/tutorials/images/consumer.png similarity index 100% rename from content/develop/connect/insight/tutorials/images/consumer.png rename to content/develop/tools/insight/tutorials/images/consumer.png diff --git a/content/develop/connect/insight/tutorials/images/insight_streams.png b/content/develop/tools/insight/tutorials/images/insight_streams.png similarity index 100% rename from content/develop/connect/insight/tutorials/images/insight_streams.png rename to content/develop/tools/insight/tutorials/images/insight_streams.png diff --git a/content/develop/connect/insight/tutorials/images/stream.png b/content/develop/tools/insight/tutorials/images/stream.png similarity index 100% rename from content/develop/connect/insight/tutorials/images/stream.png rename to content/develop/tools/insight/tutorials/images/stream.png diff --git a/content/develop/connect/insight/tutorials/insight-stream-consumer.md b/content/develop/tools/insight/tutorials/insight-stream-consumer.md similarity index 100% rename from content/develop/connect/insight/tutorials/insight-stream-consumer.md rename to content/develop/tools/insight/tutorials/insight-stream-consumer.md diff --git a/content/develop/connect/redis-for-vscode/_index.md b/content/develop/tools/redis-for-vscode/_index.md similarity index 100% rename from content/develop/connect/redis-for-vscode/_index.md rename to content/develop/tools/redis-for-vscode/_index.md diff --git a/content/develop/connect/redis-for-vscode/release-notes/_index.md b/content/develop/tools/redis-for-vscode/release-notes/_index.md similarity index 100% rename from content/develop/connect/redis-for-vscode/release-notes/_index.md rename to content/develop/tools/redis-for-vscode/release-notes/_index.md diff --git a/content/develop/connect/redis-for-vscode/release-notes/v1.0.0.md b/content/develop/tools/redis-for-vscode/release-notes/v1.0.0.md similarity index 100% rename from content/develop/connect/redis-for-vscode/release-notes/v1.0.0.md rename to content/develop/tools/redis-for-vscode/release-notes/v1.0.0.md From e72ad000a061b58b41c6d88b6be5f639908d35ca Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Thu, 7 Nov 2024 10:24:52 +0000 Subject: [PATCH 03/17] DOC-4543 renaming and moving Python/Java libs up a level --- content/develop/clients/_index.md | 7 +++-- content/develop/clients/dotnet/_index.md | 6 ++--- content/develop/clients/go/_index.md | 6 ++--- content/develop/clients/go/connect.md | 2 -- content/develop/clients/java/_index.md | 27 ------------------- content/develop/clients/{java => }/jedis.md | 6 ++--- content/develop/clients/{java => }/lettuce.md | 6 ++--- content/develop/clients/nodejs.md | 6 ++--- content/develop/clients/om-clients/_index.md | 2 +- content/develop/clients/php.md | 6 ++--- content/develop/clients/pools-and-muxing.md | 2 +- content/develop/clients/python/_index.md | 26 ------------------ .../develop/clients/{python => }/redis-py.md | 4 +-- .../develop/clients/{python => }/redis-vl.md | 6 ++--- content/develop/tools/_index.md | 2 +- 15 files changed, 29 insertions(+), 85 deletions(-) delete mode 100644 content/develop/clients/java/_index.md rename content/develop/clients/{java => }/jedis.md (99%) rename content/develop/clients/{java => }/lettuce.md (99%) delete mode 100644 content/develop/clients/python/_index.md rename content/develop/clients/{python => }/redis-py.md (99%) rename content/develop/clients/{python => }/redis-vl.md (75%) diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index ab60d7ea8f..1d3e7ba8df 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -9,9 +9,10 @@ categories: - oss - kubernetes - clients +hideListLinks: true description: Connect your application to a Redis database and try an example -linkTitle: Clients -title: Connect with Redis clients +linkTitle: Client APIs 👩🏻‍💻 +title: Connect with Redis client API libraries weight: 30 --- @@ -58,5 +59,3 @@ You can experiment with a local installation of Redis Stack To interact with a Redis server without writing code, use the [Redis CLI]({{< relref "/develop/connect/cli" >}}) and [Redis Insight]({{< relref "/develop/connect/insight" >}}) tools. - -## Client library guides diff --git a/content/develop/clients/dotnet/_index.md b/content/develop/clients/dotnet/_index.md index 5e234609f3..49e8b5d848 100644 --- a/content/develop/clients/dotnet/_index.md +++ b/content/develop/clients/dotnet/_index.md @@ -10,9 +10,9 @@ categories: - kubernetes - clients description: Connect your .NET application to a Redis database -linkTitle: C#/.NET -title: C#/.NET guide -weight: 2 +linkTitle: NRedisStack (C#/.NET) +title: NRedisStack guide (C#/.NET) +weight: 3 --- [NRedisStack](https://github.com/redis/NRedisStack) is the .NET client for Redis. diff --git a/content/develop/clients/go/_index.md b/content/develop/clients/go/_index.md index 8cb728220b..2891a32c39 100644 --- a/content/develop/clients/go/_index.md +++ b/content/develop/clients/go/_index.md @@ -10,9 +10,9 @@ categories: - kubernetes - clients description: Connect your Go application to a Redis database -linkTitle: Go -title: Go guide -weight: 5 +linkTitle: go-redis (Go) +title: go-redis guide (Go) +weight: 7 --- [`go-redis`](https://github.com/redis/go-redis) is the [Go](https://go.dev/) client for Redis. diff --git a/content/develop/clients/go/connect.md b/content/develop/clients/go/connect.md index a164cadf5e..b75881e833 100644 --- a/content/develop/clients/go/connect.md +++ b/content/develop/clients/go/connect.md @@ -17,8 +17,6 @@ weight: 1 ## Basic connection -## Connect - The following example shows the simplest way to connect to a Redis server: ```go diff --git a/content/develop/clients/java/_index.md b/content/develop/clients/java/_index.md deleted file mode 100644 index da7dd82898..0000000000 --- a/content/develop/clients/java/_index.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -categories: -- docs -- develop -- stack -- oss -- rs -- rc -- oss -- kubernetes -- clients -hideListLinks: true -description: Connect your application to a Redis database using Java and try an example -linkTitle: Java -title: Connect with Redis Java clients -weight: 4 ---- - -You have two choices of Java clients that you can use with Redis: - -- [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}), for synchronous applications. -- [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}), - for synchronous, asynchronous, and reactive applications. - -You can also access Redis with an object-mapping client interface. See -[RedisOM for Java]({{< relref "/integrate/redisom-for-java" >}}) -for more information. diff --git a/content/develop/clients/java/jedis.md b/content/develop/clients/jedis.md similarity index 99% rename from content/develop/clients/java/jedis.md rename to content/develop/clients/jedis.md index 7d2214a604..f9aaa7d3fd 100644 --- a/content/develop/clients/java/jedis.md +++ b/content/develop/clients/jedis.md @@ -10,9 +10,9 @@ categories: - kubernetes - clients description: Connect your Java application to a Redis database -linkTitle: Jedis -title: Jedis guide -weight: 1 +linkTitle: Jedis (Java) +title: Jedis guide (Java) +weight: 5 --- [Jedis](https://github.com/redis/jedis) is a synchronous Java client for Redis. diff --git a/content/develop/clients/java/lettuce.md b/content/develop/clients/lettuce.md similarity index 99% rename from content/develop/clients/java/lettuce.md rename to content/develop/clients/lettuce.md index 9c469a93ea..05673d3912 100644 --- a/content/develop/clients/java/lettuce.md +++ b/content/develop/clients/lettuce.md @@ -10,9 +10,9 @@ categories: - kubernetes - clients description: Connect your Lettuce application to a Redis database -linkTitle: Lettuce -title: Lettuce guide -weight: 2 +linkTitle: Lettuce (Java) +title: Lettuce guide (Java) +weight: 6 --- [Lettuce](https://github.com/redis/lettuce/tree/main/src/main) is an advanced Java client for Redis diff --git a/content/develop/clients/nodejs.md b/content/develop/clients/nodejs.md index b5704fc752..a668ba0254 100644 --- a/content/develop/clients/nodejs.md +++ b/content/develop/clients/nodejs.md @@ -10,9 +10,9 @@ categories: - kubernetes - clients description: Connect your Node.js application to a Redis database -linkTitle: Node.js -title: Node.js guide -weight: 3 +linkTitle: node-redis (Node.js) +title: node-redis guide (Node.js) +weight: 4 --- [node-redis](https://github.com/redis/node-redis) is the Redis client for Node.js. diff --git a/content/develop/clients/om-clients/_index.md b/content/develop/clients/om-clients/_index.md index 4954932d7d..3cb25e174a 100644 --- a/content/develop/clients/om-clients/_index.md +++ b/content/develop/clients/om-clients/_index.md @@ -13,7 +13,7 @@ description: Object-Mapper libraries for Redis Stack linkTitle: Object mapping stack: true title: Object-Mapper libraries -weight: 7 +weight: 10 --- Redis OM (pronounced *REDiss OHM*) is a library that provides object mapping for Redis. With the help of Redis OM, you can map Redis data types, specifically Hashes and JSON documents, to objects of your preferred programming language or framework. Redis OM relies on Redis Stack's JSON, query, and search features, allowing you to query and search for objects. diff --git a/content/develop/clients/php.md b/content/develop/clients/php.md index 1c81beb955..3cbb081dc3 100644 --- a/content/develop/clients/php.md +++ b/content/develop/clients/php.md @@ -10,9 +10,9 @@ categories: - kubernetes - clients description: Connect your PHP application to a Redis database -linkTitle: PHP -title: PHP guide -weight: 6 +linkTitle: Predis (PHP) +title: Predis guide (PHP) +weight: 8 --- [`Predis`](https://github.com/predis/predis) is the recommended [PHP](https://php.net/) diff --git a/content/develop/clients/pools-and-muxing.md b/content/develop/clients/pools-and-muxing.md index 82725e34bf..d634bd6019 100644 --- a/content/develop/clients/pools-and-muxing.md +++ b/content/develop/clients/pools-and-muxing.md @@ -12,7 +12,7 @@ categories: description: Manage Redis connections efficiently linkTitle: Pooling/multiplexing title: Connection pools and multiplexing -weight: 10 +weight: 30 --- Redis example code generally opens a connection, demonstrates diff --git a/content/develop/clients/python/_index.md b/content/develop/clients/python/_index.md deleted file mode 100644 index 5d48a2dc65..0000000000 --- a/content/develop/clients/python/_index.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -categories: -- docs -- develop -- stack -- oss -- rs -- rc -- oss -- kubernetes -- clients -hideListLinks: true -description: Connect your application to a Redis database using Python and try an example -linkTitle: Python -title: Connect with Redis Python clients -weight: 4 ---- - -You have two choices of Python clients that you can use with Redis: - -- [Redis Python library (redis-py)]({{< relref "/develop/connect/clients/python/redis-py" >}}) -- [Redis vector library (RedisVL)]({{< relref "/develop/connect/clients/python/redis-vl" >}}) - -You can also access Redis with an object-mapping client interface. See -[RedisOM for Python]({{< relref "/integrate/redisom-for-python" >}}) -for more information. diff --git a/content/develop/clients/python/redis-py.md b/content/develop/clients/redis-py.md similarity index 99% rename from content/develop/clients/python/redis-py.md rename to content/develop/clients/redis-py.md index 340a741cfa..18c6c5cd77 100644 --- a/content/develop/clients/python/redis-py.md +++ b/content/develop/clients/redis-py.md @@ -10,8 +10,8 @@ categories: - kubernetes - clients description: Connect your Python application to a Redis database -linkTitle: Redis Python library -title: Redis Python library guide +linkTitle: redis-py (Python) +title: redis-py guide (Python) weight: 1 --- diff --git a/content/develop/clients/python/redis-vl.md b/content/develop/clients/redis-vl.md similarity index 75% rename from content/develop/clients/python/redis-vl.md rename to content/develop/clients/redis-vl.md index ce7a8807ea..0e43545374 100644 --- a/content/develop/clients/python/redis-vl.md +++ b/content/develop/clients/redis-vl.md @@ -10,9 +10,9 @@ categories: - kubernetes - clients description: Connect your Python vector application to a Redis vector database -linkTitle: Redis vector library -title: Redis vector library guide -weight: 1 +linkTitle: RedisVL (Python) +title: Redis vector library guide (Python) +weight: 2 --- See the [RedisVL Guide]({{< relref "/integrate/redisvl" >}}) for more information. \ No newline at end of file diff --git a/content/develop/tools/_index.md b/content/develop/tools/_index.md index 6e1ad5b2c2..6741ac1fa8 100644 --- a/content/develop/tools/_index.md +++ b/content/develop/tools/_index.md @@ -10,7 +10,7 @@ categories: - kubernetes - clients description: Tools to interact with a Redis server -linkTitle: Tools +linkTitle: Client tools hideListLinks: true title: Redis tools weight: 25 From bd90eda659970ac87f1ababe44f27406bdb4f727 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Thu, 7 Nov 2024 11:52:55 +0000 Subject: [PATCH 04/17] DOC-4543 split redis-py and Jedis pages --- content/develop/clients/jedis/_index.md | 99 ++++++++++++ .../clients/{jedis.md => jedis/connect.md} | 130 +--------------- content/develop/clients/jedis/produsage.md | 91 +++++++++++ content/develop/clients/redis-py/_index.md | 88 +++++++++++ .../{redis-py.md => redis-py/connect.md} | 147 +----------------- content/develop/clients/redis-py/queryjson.md | 121 ++++++++++++++ 6 files changed, 409 insertions(+), 267 deletions(-) create mode 100644 content/develop/clients/jedis/_index.md rename content/develop/clients/{jedis.md => jedis/connect.md} (71%) create mode 100644 content/develop/clients/jedis/produsage.md create mode 100644 content/develop/clients/redis-py/_index.md rename content/develop/clients/{redis-py.md => redis-py/connect.md} (61%) create mode 100644 content/develop/clients/redis-py/queryjson.md diff --git a/content/develop/clients/jedis/_index.md b/content/develop/clients/jedis/_index.md new file mode 100644 index 0000000000..2e4a124c2d --- /dev/null +++ b/content/develop/clients/jedis/_index.md @@ -0,0 +1,99 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your Java application to a Redis database +linkTitle: Jedis (Java) +title: Jedis guide (Java) +weight: 5 +--- + +[Jedis](https://github.com/redis/jedis) is a synchronous Java client for Redis. +Use [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}) if you need +a more advanced Java client that also supports asynchronous and reactive connections. +The sections below explain how to install `Jedis` and connect your application +to a Redis database. + +`Jedis` requires a running Redis or [Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation instructions. + +## Install + +To include `Jedis` as a dependency in your application, edit the dependency file, as follows. + +* If you use **Maven**: + + ```xml + + redis.clients + jedis + 5.2.0 + + ``` + +* If you use **Gradle**: + + ``` + repositories { + mavenCentral() + } + //... + dependencies { + implementation 'redis.clients:jedis:5.2.0' + //... + } + ``` + +* If you use the JAR files, download the latest Jedis and Apache Commons Pool2 JAR files from [Maven Central](https://central.sonatype.com/) or any other Maven repository. + +* Build from [source](https://github.com/redis/jedis) + + +## Connect and test + +The following code opens a basic connection to a local Redis server: + +```java +package org.example; +import redis.clients.jedis.UnifiedJedis; + +public class Main { + public static void main(String[] args) { + UnifiedJedis jedis = new UnifiedJedis("redis://localhost:6379"); + + // Code that interacts with Redis... + + jedis.close(); + } +} +``` + +After you have connected, you can check the connection by storing and +retrieving a simple string value: + +```java +... + +String res1 = jedis.set("bike:1", "Deimos"); +System.out.println(res1); // OK + +String res2 = jedis.get("bike:1"); +System.out.println(res2); // Deimos + +... +``` + +## More information + +`Jedis` has a complete [API reference](https://www.javadoc.io/doc/redis.clients/jedis/latest/index.html) available on [javadoc.io/](https://javadoc.io/). +The `Jedis` [GitHub repository](https://github.com/redis/jedis) also has useful docs +and examples including a page about handling +[failover with Jedis](https://github.com/redis/jedis/blob/master/docs/failover.md) + +See also the other pages in this section for more information and examples: diff --git a/content/develop/clients/jedis.md b/content/develop/clients/jedis/connect.md similarity index 71% rename from content/develop/clients/jedis.md rename to content/develop/clients/jedis/connect.md index f9aaa7d3fd..4f40296582 100644 --- a/content/develop/clients/jedis.md +++ b/content/develop/clients/jedis/connect.md @@ -10,51 +10,12 @@ categories: - kubernetes - clients description: Connect your Java application to a Redis database -linkTitle: Jedis (Java) -title: Jedis guide (Java) -weight: 5 +linkTitle: Connect +title: Connect to the server +weight: 2 --- -[Jedis](https://github.com/redis/jedis) is a synchronous Java client for Redis. -Use [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}) if you need -a more advanced Java client that also supports asynchronous and reactive connections. -The sections below explain how to install `Jedis` and connect your application -to a Redis database. - -`Jedis` requires a running Redis or [Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation instructions. - -## Install - -To include `Jedis` as a dependency in your application, edit the dependency file, as follows. - -* If you use **Maven**: - - ```xml - - redis.clients - jedis - 5.2.0 - - ``` - -* If you use **Gradle**: - - ``` - repositories { - mavenCentral() - } - //... - dependencies { - implementation 'redis.clients:jedis:5.2.0' - //... - } - ``` - -* If you use the JAR files, download the latest Jedis and Apache Commons Pool2 JAR files from [Maven Central](https://central.sonatype.com/) or any other Maven repository. - -* Build from [source](https://github.com/redis/jedis) - -## Connect +## Basic connection The following code opens a basic connection to a local Redis server: @@ -402,86 +363,3 @@ poolConfig.setTimeBetweenEvictionRuns(Duration.ofSeconds(1)); // to prevent connection starvation JedisPooled jedis = new JedisPooled(poolConfig, "localhost", 6379); ``` - -## Production usage - -The following sections explain how to handle situations that may occur -in your production environment. - -### Timeouts - -To set a timeout for a connection, use the `JedisPooled` or `JedisPool` constructor with the `timeout` parameter, or use `JedisClientConfig` with the `socketTimeout` and `connectionTimeout` parameters: - -```java -HostAndPort hostAndPort = new HostAndPort("localhost", 6379); - -JedisPooled jedisWithTimeout = new JedisPooled(hostAndPort, - DefaultJedisClientConfig.builder() - .socketTimeoutMillis(5000) // set timeout to 5 seconds - .connectionTimeoutMillis(5000) // set connection timeout to 5 seconds - .build(), - poolConfig -); -``` - -### Exception handling - -The Jedis Exception Hierarchy is rooted on `JedisException`, which implements `RuntimeException`, and are therefore all unchecked exceptions. - -``` -JedisException -├── JedisDataException -│ ├── JedisRedirectionException -│ │ ├── JedisMovedDataException -│ │ └── JedisAskDataException -│ ├── AbortedTransactionException -│ ├── JedisAccessControlException -│ └── JedisNoScriptException -├── JedisClusterException -│ ├── JedisClusterOperationException -│ ├── JedisConnectionException -│ └── JedisValidationException -└── InvalidURIException -``` - -#### General exceptions - -In general, Jedis can throw the following exceptions while executing commands: - -- `JedisConnectionException` - when the connection to Redis is lost or closed unexpectedly. Configure failover to handle this exception automatically with Resilience4J and the built-in Jedis failover mechanism. -- `JedisAccessControlException` - when the user does not have the permission to execute the command or the user ID and/or password are incorrect. -- `JedisDataException` - when there is a problem with the data being sent to or received from the Redis server. Usually, the error message will contain more information about the failed command. -- `JedisException` - this exception is a catch-all exception that can be thrown for any other unexpected errors. - -Conditions when `JedisException` can be thrown: -- Bad return from a health check with the [`PING`]({{< relref "/commands/ping" >}}) command -- Failure during SHUTDOWN -- Pub/Sub failure when issuing commands (disconnect) -- Any unknown server messages -- Sentinel: can connect to sentinel but master is not monitored or all Sentinels are down. -- MULTI or DISCARD command failed -- Shard commands key hash check failed or no Reachable Shards -- Retry deadline exceeded/number of attempts (Retry Command Executor) -- POOL - pool exhausted, error adding idle objects, returning broken resources to the pool - -All the Jedis exceptions are runtime exceptions and in most cases irrecoverable, so in general bubble up to the API capturing the error message. - -### DNS cache and Redis - -When you connect to a Redis server with multiple endpoints, such as [Redis Enterprise Active-Active](https://redis.com/redis-enterprise/technology/active-active-geo-distribution/), you *must* -disable the JVM's DNS cache. If a server node or proxy fails, the IP address for any database -affected by the failure will change. When this happens, your app will keep -trying to use the stale IP address if DNS caching is enabled. - -Use the following code to disable the DNS cache: - -```java -java.security.Security.setProperty("networkaddress.cache.ttl","0"); -java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0"); -``` - -## Learn more - -* [Jedis API reference](https://www.javadoc.io/doc/redis.clients/jedis/latest/index.html) -* [Failover with Jedis](https://github.com/redis/jedis/blob/master/docs/failover.md) -* [GitHub](https://github.com/redis/jedis) diff --git a/content/develop/clients/jedis/produsage.md b/content/develop/clients/jedis/produsage.md new file mode 100644 index 0000000000..8cf2518859 --- /dev/null +++ b/content/develop/clients/jedis/produsage.md @@ -0,0 +1,91 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Get your Jedis app ready for production +linkTitle: Production usage +title: Production usage +weight: 3 +--- + +The following sections explain how to handle situations that may occur +in your production environment. + +### Timeouts + +To set a timeout for a connection, use the `JedisPooled` or `JedisPool` constructor with the `timeout` parameter, or use `JedisClientConfig` with the `socketTimeout` and `connectionTimeout` parameters: + +```java +HostAndPort hostAndPort = new HostAndPort("localhost", 6379); + +JedisPooled jedisWithTimeout = new JedisPooled(hostAndPort, + DefaultJedisClientConfig.builder() + .socketTimeoutMillis(5000) // set timeout to 5 seconds + .connectionTimeoutMillis(5000) // set connection timeout to 5 seconds + .build(), + poolConfig +); +``` + +### Exception handling + +The Jedis Exception Hierarchy is rooted on `JedisException`, which implements `RuntimeException`, and are therefore all unchecked exceptions. + +``` +JedisException +├── JedisDataException +│ ├── JedisRedirectionException +│ │ ├── JedisMovedDataException +│ │ └── JedisAskDataException +│ ├── AbortedTransactionException +│ ├── JedisAccessControlException +│ └── JedisNoScriptException +├── JedisClusterException +│ ├── JedisClusterOperationException +│ ├── JedisConnectionException +│ └── JedisValidationException +└── InvalidURIException +``` + +#### General exceptions + +In general, Jedis can throw the following exceptions while executing commands: + +- `JedisConnectionException` - when the connection to Redis is lost or closed unexpectedly. Configure failover to handle this exception automatically with Resilience4J and the built-in Jedis failover mechanism. +- `JedisAccessControlException` - when the user does not have the permission to execute the command or the user ID and/or password are incorrect. +- `JedisDataException` - when there is a problem with the data being sent to or received from the Redis server. Usually, the error message will contain more information about the failed command. +- `JedisException` - this exception is a catch-all exception that can be thrown for any other unexpected errors. + +Conditions when `JedisException` can be thrown: +- Bad return from a health check with the [`PING`]({{< relref "/commands/ping" >}}) command +- Failure during SHUTDOWN +- Pub/Sub failure when issuing commands (disconnect) +- Any unknown server messages +- Sentinel: can connect to sentinel but master is not monitored or all Sentinels are down. +- MULTI or DISCARD command failed +- Shard commands key hash check failed or no Reachable Shards +- Retry deadline exceeded/number of attempts (Retry Command Executor) +- POOL - pool exhausted, error adding idle objects, returning broken resources to the pool + +All the Jedis exceptions are runtime exceptions and in most cases irrecoverable, so in general bubble up to the API capturing the error message. + +### DNS cache and Redis + +When you connect to a Redis server with multiple endpoints, such as [Redis Enterprise Active-Active](https://redis.com/redis-enterprise/technology/active-active-geo-distribution/), you *must* +disable the JVM's DNS cache. If a server node or proxy fails, the IP address for any database +affected by the failure will change. When this happens, your app will keep +trying to use the stale IP address if DNS caching is enabled. + +Use the following code to disable the DNS cache: + +```java +java.security.Security.setProperty("networkaddress.cache.ttl","0"); +java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0"); +``` diff --git a/content/develop/clients/redis-py/_index.md b/content/develop/clients/redis-py/_index.md new file mode 100644 index 0000000000..264dc0db7b --- /dev/null +++ b/content/develop/clients/redis-py/_index.md @@ -0,0 +1,88 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your Python application to a Redis database +linkTitle: redis-py (Python) +title: redis-py guide (Python) +weight: 1 +--- + +[redis-py](https://github.com/redis/redis-py) is the Python client for Redis. +The sections below explain how to install `redis-py` and connect your application +to a Redis database. + +`redis-py` requires a running Redis or [Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation instructions. + +You can also access Redis with an object-mapping client interface. See +[RedisOM for Python]({{< relref "/integrate/redisom-for-python" >}}) +for more information. + +## Install + +To install `redis-py`, enter: + +```bash +pip install redis +``` + +For faster performance, install Redis with [`hiredis`](https://github.com/redis/hiredis) support. This provides a compiled response parser, and for most cases requires zero code changes. By default, if `hiredis` >= 1.0 is available, `redis-py` attempts to use it for response parsing. + +{{% alert title="Note" %}} +The Python `distutils` packaging scheme is no longer part of Python 3.12 and greater. If you're having difficulties getting `redis-py` installed in a Python 3.12 environment, consider updating to a recent release of `redis-py`. +{{% /alert %}} + +```bash +pip install redis[hiredis] +``` + +## Connect and test + +Connect to localhost on port 6379, set a value in Redis, and retrieve it. All responses are returned as bytes in Python. To receive decoded strings, set `decode_responses=True`. For more connection options, see [these examples](https://redis.readthedocs.io/en/stable/examples.html). + +```python +r = redis.Redis(host='localhost', port=6379, decode_responses=True) +``` + +Store and retrieve a simple string. + +```python +r.set('foo', 'bar') +# True +r.get('foo') +# bar +``` + +Store and retrieve a dict. + +```python +r.hset('user-session:123', mapping={ + 'name': 'John', + "surname": 'Smith', + "company": 'Redis', + "age": 29 +}) +# True + +r.hgetall('user-session:123') +# {'surname': 'Smith', 'name': 'John', 'company': 'Redis', 'age': '29'} +``` + + + +## More information + +The [`redis-py`](https://redis-py.readthedocs.io/en/stable/index.html) website +has a [command reference](https://redis-py.readthedocs.io/en/stable/commands.html) +and some [tutorials](https://redis.readthedocs.io/en/stable/examples.html) for +various tasks. There are also some examples in the +[GitHub repository](https://github.com/redis/redis-py) for `redis-py`. + +See also the other pages in this section for more information and examples: \ No newline at end of file diff --git a/content/develop/clients/redis-py.md b/content/develop/clients/redis-py/connect.md similarity index 61% rename from content/develop/clients/redis-py.md rename to content/develop/clients/redis-py/connect.md index 18c6c5cd77..f0b2f66579 100644 --- a/content/develop/clients/redis-py.md +++ b/content/develop/clients/redis-py/connect.md @@ -10,40 +10,12 @@ categories: - kubernetes - clients description: Connect your Python application to a Redis database -linkTitle: redis-py (Python) -title: redis-py guide (Python) -weight: 1 +linkTitle: Connect +title: Connect to the server +weight: 2 --- -[redis-py](https://github.com/redis/redis-py) is the Python client for Redis. -The sections below explain how to install `redis-py` and connect your application -to a Redis database. - -`redis-py` requires a running Redis or [Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation instructions. - -You can also access Redis with an object-mapping client interface. See -[RedisOM for Python]({{< relref "/integrate/redisom-for-python" >}}) -for more information. - -## Install - -To install `redis-py`, enter: - -```bash -pip install redis -``` - -For faster performance, install Redis with [`hiredis`](https://github.com/redis/hiredis) support. This provides a compiled response parser, and for most cases requires zero code changes. By default, if `hiredis` >= 1.0 is available, `redis-py` attempts to use it for response parsing. - -{{% alert title="Note" %}} -The Python `distutils` packaging scheme is no longer part of Python 3.12 and greater. If you're having difficulties getting `redis-py` installed in a Python 3.12 environment, consider updating to a recent release of `redis-py`. -{{% /alert %}} - -```bash -pip install redis[hiredis] -``` - -## Connect +## Basic connection Connect to localhost on port 6379, set a value in Redis, and retrieve it. All responses are returned as bytes in Python. To receive decoded strings, set `decode_responses=True`. For more connection options, see [these examples](https://redis.readthedocs.io/en/stable/examples.html). @@ -75,7 +47,7 @@ r.hgetall('user-session:123') # {'surname': 'Smith', 'name': 'John', 'company': 'Redis', 'age': '29'} ``` -### Connect to a Redis cluster +## Connect to a Redis cluster To connect to a Redis cluster, use `RedisCluster`. @@ -95,7 +67,7 @@ rc.get('foo') ``` For more information, see [redis-py Clustering](https://redis-py.readthedocs.io/en/stable/clustering.html). -### Connect to your production Redis with TLS +## Connect to your production Redis with TLS When you deploy your application, use TLS and follow the [Redis security]({{< relref "/operate/oss_and_stack/management/security/" >}}) guidelines. @@ -265,110 +237,3 @@ r3.close() pool.close() ``` - -## Example: Indexing and querying JSON documents - -Make sure that you have Redis Stack and `redis-py` installed. Import dependencies: - -```python -import redis -from redis.commands.json.path import Path -import redis.commands.search.aggregation as aggregations -import redis.commands.search.reducers as reducers -from redis.commands.search.field import TextField, NumericField, TagField -from redis.commands.search.indexDefinition import IndexDefinition, IndexType -from redis.commands.search.query import NumericFilter, Query -``` - -Connect to your Redis database. - -```python -r = redis.Redis(host='localhost', port=6379) -``` - -Let's create some test data to add to your database. - -```python -user1 = { - "name": "Paul John", - "email": "paul.john@example.com", - "age": 42, - "city": "London" -} -user2 = { - "name": "Eden Zamir", - "email": "eden.zamir@example.com", - "age": 29, - "city": "Tel Aviv" -} -user3 = { - "name": "Paul Zamir", - "email": "paul.zamir@example.com", - "age": 35, - "city": "Tel Aviv" -} -``` - -Define indexed fields and their data types using `schema`. Use JSON path expressions to map specific JSON elements to the schema fields. - -```python -schema = ( - TextField("$.name", as_name="name"), - TagField("$.city", as_name="city"), - NumericField("$.age", as_name="age") -) -``` - -Create an index. In this example, all JSON documents with the key prefix `user:` will be indexed. For more information, see [Query syntax]({{< relref "/develop/interact/search-and-query/query/" >}}). - -```python -rs = r.ft("idx:users") -rs.create_index( - schema, - definition=IndexDefinition( - prefix=["user:"], index_type=IndexType.JSON - ) -) -# b'OK' -``` - -Use [`JSON.SET`]({{< baseurl >}}/commands/json.set/) to set each user value at the specified path. - -```python -r.json().set("user:1", Path.root_path(), user1) -r.json().set("user:2", Path.root_path(), user2) -r.json().set("user:3", Path.root_path(), user3) -``` - -Let's find user `Paul` and filter the results by age. - -```python -res = rs.search( - Query("Paul @age:[30 40]") -) -# Result{1 total, docs: [Document {'id': 'user:3', 'payload': None, 'json': '{"name":"Paul Zamir","email":"paul.zamir@example.com","age":35,"city":"Tel Aviv"}'}]} -``` - -Query using JSON Path expressions. - -```python -rs.search( - Query("Paul").return_field("$.city", as_field="city") -).docs -# [Document {'id': 'user:1', 'payload': None, 'city': 'London'}, Document {'id': 'user:3', 'payload': None, 'city': 'Tel Aviv'}] -``` - -Aggregate your results using [`FT.AGGREGATE`]({{< baseurl >}}/commands/ft.aggregate/). - -```python -req = aggregations.AggregateRequest("*").group_by('@city', reducers.count().alias('count')) -print(rs.aggregate(req).rows) -# [[b'city', b'Tel Aviv', b'count', b'2'], [b'city', b'London', b'count', b'1']] -``` - -## Learn more - -* [Command reference](https://redis-py.readthedocs.io/en/stable/commands.html) -* [Tutorials](https://redis.readthedocs.io/en/stable/examples.html) -* [GitHub](https://github.com/redis/redis-py) - diff --git a/content/develop/clients/redis-py/queryjson.md b/content/develop/clients/redis-py/queryjson.md new file mode 100644 index 0000000000..cef016d406 --- /dev/null +++ b/content/develop/clients/redis-py/queryjson.md @@ -0,0 +1,121 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Learn how to use the Redis query engine with JSON +linkTitle: JSON query example +title: Example - Index and query JSON documents +weight: 2 +--- + +This example shows how to create a +[search index]({{< relref "/develop/interact/search-and-query/indexing" >}}) +for [JSON]({{< relref "/develop/data-types/json" >}}) data and +run queries against the index. + +Make sure that you have Redis Stack and `redis-py` installed. + +Import dependencies: + +```python +import redis +from redis.commands.json.path import Path +import redis.commands.search.aggregation as aggregations +import redis.commands.search.reducers as reducers +from redis.commands.search.field import TextField, NumericField, TagField +from redis.commands.search.indexDefinition import IndexDefinition, IndexType +from redis.commands.search.query import NumericFilter, Query +``` + +Connect to your Redis database. + +```python +r = redis.Redis(host='localhost', port=6379) +``` + +Let's create some test data to add to your database. + +```python +user1 = { + "name": "Paul John", + "email": "paul.john@example.com", + "age": 42, + "city": "London" +} +user2 = { + "name": "Eden Zamir", + "email": "eden.zamir@example.com", + "age": 29, + "city": "Tel Aviv" +} +user3 = { + "name": "Paul Zamir", + "email": "paul.zamir@example.com", + "age": 35, + "city": "Tel Aviv" +} +``` + +Define indexed fields and their data types using `schema`. Use JSON path expressions to map specific JSON elements to the schema fields. + +```python +schema = ( + TextField("$.name", as_name="name"), + TagField("$.city", as_name="city"), + NumericField("$.age", as_name="age") +) +``` + +Create an index. In this example, all JSON documents with the key prefix `user:` will be indexed. For more information, see [Query syntax]({{< relref "/develop/interact/search-and-query/query/" >}}). + +```python +rs = r.ft("idx:users") +rs.create_index( + schema, + definition=IndexDefinition( + prefix=["user:"], index_type=IndexType.JSON + ) +) +# b'OK' +``` + +Use [`JSON.SET`]({{< baseurl >}}/commands/json.set/) to set each user value at the specified path. + +```python +r.json().set("user:1", Path.root_path(), user1) +r.json().set("user:2", Path.root_path(), user2) +r.json().set("user:3", Path.root_path(), user3) +``` + +Let's find user `Paul` and filter the results by age. + +```python +res = rs.search( + Query("Paul @age:[30 40]") +) +# Result{1 total, docs: [Document {'id': 'user:3', 'payload': None, 'json': '{"name":"Paul Zamir","email":"paul.zamir@example.com","age":35,"city":"Tel Aviv"}'}]} +``` + +Query using JSON Path expressions. + +```python +rs.search( + Query("Paul").return_field("$.city", as_field="city") +).docs +# [Document {'id': 'user:1', 'payload': None, 'city': 'London'}, Document {'id': 'user:3', 'payload': None, 'city': 'Tel Aviv'}] +``` + +Aggregate your results using [`FT.AGGREGATE`]({{< baseurl >}}/commands/ft.aggregate/). + +```python +req = aggregations.AggregateRequest("*").group_by('@city', reducers.count().alias('count')) +print(rs.aggregate(req).rows) +# [[b'city', b'Tel Aviv', b'count', b'2'], [b'city', b'London', b'count', b'1']] +``` \ No newline at end of file From 29750f40c4df39a3ebd734b2420d25774d94a2da Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Thu, 7 Nov 2024 12:57:43 +0000 Subject: [PATCH 05/17] DOC-4543 started splitting Lettuce page --- .../clients/{lettuce.md => lettuce/_index.md} | 133 ++-------- content/develop/clients/lettuce/connect.md | 236 ++++++++++++++++++ 2 files changed, 254 insertions(+), 115 deletions(-) rename content/develop/clients/{lettuce.md => lettuce/_index.md} (63%) create mode 100644 content/develop/clients/lettuce/connect.md diff --git a/content/develop/clients/lettuce.md b/content/develop/clients/lettuce/_index.md similarity index 63% rename from content/develop/clients/lettuce.md rename to content/develop/clients/lettuce/_index.md index 05673d3912..2b767bcad8 100644 --- a/content/develop/clients/lettuce.md +++ b/content/develop/clients/lettuce/_index.md @@ -51,135 +51,38 @@ If you wish to use the JAR files directly, download the latest Lettuce and, opti To build from source, see the instructions on the [Lettuce source code GitHub repo](https://github.com/lettuce-io/lettuce-core). -## Connect +## Connect and test -Start by creating a connection to your Redis server. There are many ways to achieve this using Lettuce. Here are a few. - -### Asynchronous connection +Connect to a local server using the following code. This example +also stores and retrieves a simple string value to test the connection. ```java -package org.example; -import java.util.*; -import java.util.concurrent.ExecutionException; - import io.lettuce.core.*; -import io.lettuce.core.api.async.RedisAsyncCommands; import io.lettuce.core.api.StatefulRedisConnection; +import io.lettuce.core.api.sync.RedisCommands; -public class Async { - public static void main(String[] args) { - RedisClient redisClient = RedisClient.create("redis://localhost:6379"); - - try (StatefulRedisConnection connection = redisClient.connect()) { - RedisAsyncCommands asyncCommands = connection.async(); - - // Asynchronously store & retrieve a simple string - asyncCommands.set("foo", "bar").get(); - System.out.println(asyncCommands.get("foo").get()); // prints bar - - // Asynchronously store key-value pairs in a hash directly - Map hash = new HashMap<>(); - hash.put("name", "John"); - hash.put("surname", "Smith"); - hash.put("company", "Redis"); - hash.put("age", "29"); - asyncCommands.hset("user-session:123", hash).get(); - - System.out.println(asyncCommands.hgetall("user-session:123").get()); - // Prints: {name=John, surname=Smith, company=Redis, age=29} - } catch (ExecutionException | InterruptedException e) { - throw new RuntimeException(e); - } finally { - redisClient.shutdown(); - } - } -} -``` +public class ConnectBasicTest { -Learn more about asynchronous Lettuce API in [the reference guide](https://redis.github.io/lettuce/#asynchronous-api). + public void connectBasic() { + RedisURI uri = RedisURI.Builder + .redis("localhost", 6379) + .build(); + + RedisClient client = RedisClient.create(uri); + StatefulRedisConnection connection = client.connect(); + RedisCommands commands = connection.sync(); -### Reactive connection + commands.set("foo", "bar"); + String result = commands.get("foo"); + System.out.println(result); // >>> bar -```java -package org.example; -import java.util.*; -import io.lettuce.core.*; -import io.lettuce.core.api.reactive.RedisReactiveCommands; -import io.lettuce.core.api.StatefulRedisConnection; + connection.close(); -public class Main { - public static void main(String[] args) { - RedisClient redisClient = RedisClient.create("redis://localhost:6379"); - - try (StatefulRedisConnection connection = redisClient.connect()) { - RedisReactiveCommands reactiveCommands = connection.reactive(); - - // Reactively store & retrieve a simple string - reactiveCommands.set("foo", "bar").block(); - reactiveCommands.get("foo").doOnNext(System.out::println).block(); // prints bar - - // Reactively store key-value pairs in a hash directly - Map hash = new HashMap<>(); - hash.put("name", "John"); - hash.put("surname", "Smith"); - hash.put("company", "Redis"); - hash.put("age", "29"); - - reactiveCommands.hset("user-session:124", hash).then( - reactiveCommands.hgetall("user-session:124") - .collectMap(KeyValue::getKey, KeyValue::getValue).doOnNext(System.out::println)) - .block(); - // Prints: {surname=Smith, name=John, company=Redis, age=29} - - } finally { - redisClient.shutdown(); + client.shutdown(); } - } } ``` -Learn more about reactive Lettuce API in [the reference guide](https://redis.github.io/lettuce/#reactive-api). - -### Redis Cluster connection - -```java -import io.lettuce.core.RedisURI; -import io.lettuce.core.cluster.RedisClusterClient; -import io.lettuce.core.cluster.api.StatefulRedisClusterConnection; -import io.lettuce.core.cluster.api.async.RedisAdvancedClusterAsyncCommands; - -// ... - -RedisURI redisUri = RedisURI.Builder.redis("localhost").withPassword("authentication").build(); - -RedisClusterClient clusterClient = RedisClusterClient.create(redisUri); -StatefulRedisClusterConnection connection = clusterClient.connect(); -RedisAdvancedClusterAsyncCommands commands = connection.async(); - -// ... - -connection.close(); -clusterClient.shutdown(); -``` - -### TLS connection - -When you deploy your application, use TLS and follow the [Redis security guidelines]({{< relref "/operate/oss_and_stack/management/security/" >}}). - -```java -RedisURI redisUri = RedisURI.Builder.redis("localhost") - .withSsl(true) - .withPassword("secret!") // use your Redis password - .build(); - -RedisClient client = RedisClient.create(redisUri); -``` - -## Connection Management in Lettuce - -Lettuce uses `ClientResources` for efficient management of shared resources like event loop groups and thread pools. -For connection pooling, Lettuce leverages `RedisClient` or `RedisClusterClient`, which can handle multiple concurrent connections efficiently. - ### Timeouts Lettuce provides timeouts for many operations, such as command execution, SSL handshake, and Sentinel discovery. By default, Lettuce uses a global timeout value of 60 seconds for these operations, but you can override the global timeout value with individual timeout values for each operation. diff --git a/content/develop/clients/lettuce/connect.md b/content/develop/clients/lettuce/connect.md new file mode 100644 index 0000000000..f4233a3bd1 --- /dev/null +++ b/content/develop/clients/lettuce/connect.md @@ -0,0 +1,236 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your .NET application to a Redis database +linkTitle: Connect +title: Connect to the server +weight: 2 +--- + +Start by creating a connection to your Redis server. There are many ways to achieve this using Lettuce. Here are a few. + +## Basic connection + +```java +import io.lettuce.core.*; +import io.lettuce.core.api.StatefulRedisConnection; +import io.lettuce.core.api.sync.RedisCommands; + +public class ConnectBasicTest { + + public void connectBasic() { + RedisURI uri = RedisURI.Builder + .redis("localhost", 6379) + .withAuthentication("default", "yourPassword") + .build(); + RedisClient client = RedisClient.create(uri); + StatefulRedisConnection connection = client.connect(); + RedisCommands commands = connection.sync(); + + commands.set("foo", "bar"); + String result = commands.get("foo"); + System.out.println(result); // >>> bar + + connection.close(); + + client.shutdown(); + } +} +``` + +### Asynchronous connection + +```java +package org.example; +import java.util.*; +import java.util.concurrent.ExecutionException; + +import io.lettuce.core.*; +import io.lettuce.core.api.async.RedisAsyncCommands; +import io.lettuce.core.api.StatefulRedisConnection; + +public class Async { + public static void main(String[] args) { + RedisClient redisClient = RedisClient.create("redis://localhost:6379"); + + try (StatefulRedisConnection connection = redisClient.connect()) { + RedisAsyncCommands asyncCommands = connection.async(); + + // Asynchronously store & retrieve a simple string + asyncCommands.set("foo", "bar").get(); + System.out.println(asyncCommands.get("foo").get()); // prints bar + + // Asynchronously store key-value pairs in a hash directly + Map hash = new HashMap<>(); + hash.put("name", "John"); + hash.put("surname", "Smith"); + hash.put("company", "Redis"); + hash.put("age", "29"); + asyncCommands.hset("user-session:123", hash).get(); + + System.out.println(asyncCommands.hgetall("user-session:123").get()); + // Prints: {name=John, surname=Smith, company=Redis, age=29} + } catch (ExecutionException | InterruptedException e) { + throw new RuntimeException(e); + } finally { + redisClient.shutdown(); + } + } +} +``` + +Learn more about asynchronous Lettuce API in [the reference guide](https://redis.github.io/lettuce/#asynchronous-api). + +### Reactive connection + +```java +package org.example; +import java.util.*; +import io.lettuce.core.*; +import io.lettuce.core.api.reactive.RedisReactiveCommands; +import io.lettuce.core.api.StatefulRedisConnection; + +public class Main { + public static void main(String[] args) { + RedisClient redisClient = RedisClient.create("redis://localhost:6379"); + + try (StatefulRedisConnection connection = redisClient.connect()) { + RedisReactiveCommands reactiveCommands = connection.reactive(); + + // Reactively store & retrieve a simple string + reactiveCommands.set("foo", "bar").block(); + reactiveCommands.get("foo").doOnNext(System.out::println).block(); // prints bar + + // Reactively store key-value pairs in a hash directly + Map hash = new HashMap<>(); + hash.put("name", "John"); + hash.put("surname", "Smith"); + hash.put("company", "Redis"); + hash.put("age", "29"); + + reactiveCommands.hset("user-session:124", hash).then( + reactiveCommands.hgetall("user-session:124") + .collectMap(KeyValue::getKey, KeyValue::getValue).doOnNext(System.out::println)) + .block(); + // Prints: {surname=Smith, name=John, company=Redis, age=29} + + } finally { + redisClient.shutdown(); + } + } +} +``` + +Learn more about reactive Lettuce API in [the reference guide](https://redis.github.io/lettuce/#reactive-api). + +## Connect to a Redis cluster + +```java +import io.lettuce.core.RedisURI; +import io.lettuce.core.cluster.RedisClusterClient; +import io.lettuce.core.cluster.api.StatefulRedisClusterConnection; +import io.lettuce.core.cluster.api.async.RedisAdvancedClusterAsyncCommands; + +// ... + +RedisURI redisUri = RedisURI.Builder.redis("localhost").withPassword("authentication").build(); + +RedisClusterClient clusterClient = RedisClusterClient.create(redisUri); +StatefulRedisClusterConnection connection = clusterClient.connect(); +RedisAdvancedClusterAsyncCommands commands = connection.async(); + +// ... + +connection.close(); +clusterClient.shutdown(); +``` + +### TLS connection + +When you deploy your application, use TLS and follow the [Redis security guidelines]({{< relref "/operate/oss_and_stack/management/security/" >}}). + +```java +RedisURI redisUri = RedisURI.Builder.redis("localhost") + .withSsl(true) + .withPassword("secret!") // use your Redis password + .build(); + +RedisClient client = RedisClient.create(redisUri); +``` + +## Connection Management in Lettuce + +Lettuce uses `ClientResources` for efficient management of shared resources like event loop groups and thread pools. +For connection pooling, Lettuce leverages `RedisClient` or `RedisClusterClient`, which can handle multiple concurrent connections efficiently. + +## Connection pooling + +A typical approach with Lettuce is to create a single `RedisClient` instance and reuse it to establish connections to your Redis server(s). +These connections are multiplexed; that is, multiple commands can be run concurrently over a single or a small set of connections, making explicit pooling less practical. +See +[Connection pools and multiplexing]({{< relref "/develop/connect/clients/pools-and-muxing" >}}) +for more information. + +Lettuce provides pool config to be used with Lettuce asynchronous connection methods. + +```java +package org.example; +import io.lettuce.core.RedisClient; +import io.lettuce.core.RedisURI; +import io.lettuce.core.TransactionResult; +import io.lettuce.core.api.StatefulRedisConnection; +import io.lettuce.core.api.async.RedisAsyncCommands; +import io.lettuce.core.codec.StringCodec; +import io.lettuce.core.support.*; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; + +public class Pool { + public static void main(String[] args) { + RedisClient client = RedisClient.create(); + + String host = "localhost"; + int port = 6379; + + CompletionStage>> poolFuture + = AsyncConnectionPoolSupport.createBoundedObjectPoolAsync( + () -> client.connectAsync(StringCodec.UTF8, RedisURI.create(host, port)), + BoundedPoolConfig.create()); + + // await poolFuture initialization to avoid NoSuchElementException: Pool exhausted when starting your application + AsyncPool> pool = poolFuture.toCompletableFuture() + .join(); + + // execute work + CompletableFuture transactionResult = pool.acquire() + .thenCompose(connection -> { + + RedisAsyncCommands async = connection.async(); + + async.multi(); + async.set("key", "value"); + async.set("key2", "value2"); + System.out.println("Executed commands in pipeline"); + return async.exec().whenComplete((s, throwable) -> pool.release(connection)); + }); + transactionResult.join(); + + // terminating + pool.closeAsync(); + + // after pool completion + client.shutdownAsync(); + } +} +``` + +In this setup, `LettuceConnectionFactory` is a custom class you would need to implement, adhering to Apache Commons Pool's `PooledObjectFactory` interface, to manage lifecycle events of pooled `StatefulRedisConnection` objects. From e321bbee3a2b5b3365dde42c5dc3a16b66b1fbdc Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Thu, 7 Nov 2024 12:58:33 +0000 Subject: [PATCH 06/17] DOC-4543 more Lettuce stuff: --- content/develop/clients/lettuce/_index.md | 65 +---------------------- 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/content/develop/clients/lettuce/_index.md b/content/develop/clients/lettuce/_index.md index 2b767bcad8..4ba870e535 100644 --- a/content/develop/clients/lettuce/_index.md +++ b/content/develop/clients/lettuce/_index.md @@ -67,7 +67,7 @@ public class ConnectBasicTest { RedisURI uri = RedisURI.Builder .redis("localhost", 6379) .build(); - + RedisClient client = RedisClient.create(uri); StatefulRedisConnection connection = client.connect(); RedisCommands commands = connection.sync(); @@ -133,69 +133,6 @@ try (RedisClient client = RedisClient.create(redisURI)) { } ``` -### Connection pooling - -A typical approach with Lettuce is to create a single `RedisClient` instance and reuse it to establish connections to your Redis server(s). -These connections are multiplexed; that is, multiple commands can be run concurrently over a single or a small set of connections, making explicit pooling less practical. -See -[Connection pools and multiplexing]({{< relref "/develop/connect/clients/pools-and-muxing" >}}) -for more information. - -Lettuce provides pool config to be used with Lettuce asynchronous connection methods. - -```java -package org.example; -import io.lettuce.core.RedisClient; -import io.lettuce.core.RedisURI; -import io.lettuce.core.TransactionResult; -import io.lettuce.core.api.StatefulRedisConnection; -import io.lettuce.core.api.async.RedisAsyncCommands; -import io.lettuce.core.codec.StringCodec; -import io.lettuce.core.support.*; - -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; - -public class Pool { - public static void main(String[] args) { - RedisClient client = RedisClient.create(); - - String host = "localhost"; - int port = 6379; - - CompletionStage>> poolFuture - = AsyncConnectionPoolSupport.createBoundedObjectPoolAsync( - () -> client.connectAsync(StringCodec.UTF8, RedisURI.create(host, port)), - BoundedPoolConfig.create()); - - // await poolFuture initialization to avoid NoSuchElementException: Pool exhausted when starting your application - AsyncPool> pool = poolFuture.toCompletableFuture() - .join(); - - // execute work - CompletableFuture transactionResult = pool.acquire() - .thenCompose(connection -> { - - RedisAsyncCommands async = connection.async(); - - async.multi(); - async.set("key", "value"); - async.set("key2", "value2"); - System.out.println("Executed commands in pipeline"); - return async.exec().whenComplete((s, throwable) -> pool.release(connection)); - }); - transactionResult.join(); - - // terminating - pool.closeAsync(); - - // after pool completion - client.shutdownAsync(); - } -} -``` - -In this setup, `LettuceConnectionFactory` is a custom class you would need to implement, adhering to Apache Commons Pool's `PooledObjectFactory` interface, to manage lifecycle events of pooled `StatefulRedisConnection` objects. ## DNS cache and Redis From e1a26930d29380e48172ee59c5fb2eea97ca5aff Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Thu, 7 Nov 2024 14:12:48 +0000 Subject: [PATCH 07/17] DOC-4543 finished Lettuce stuff --- content/develop/clients/lettuce/_index.md | 73 ++--------------- content/develop/clients/lettuce/connect.md | 4 +- content/develop/clients/lettuce/produsage.md | 84 ++++++++++++++++++++ 3 files changed, 91 insertions(+), 70 deletions(-) create mode 100644 content/develop/clients/lettuce/produsage.md diff --git a/content/develop/clients/lettuce/_index.md b/content/develop/clients/lettuce/_index.md index 4ba870e535..f60531d092 100644 --- a/content/develop/clients/lettuce/_index.md +++ b/content/develop/clients/lettuce/_index.md @@ -83,73 +83,10 @@ public class ConnectBasicTest { } ``` -### Timeouts +## More information -Lettuce provides timeouts for many operations, such as command execution, SSL handshake, and Sentinel discovery. By default, Lettuce uses a global timeout value of 60 seconds for these operations, but you can override the global timeout value with individual timeout values for each operation. +The [Lettuce reference guide](https://redis.github.io/lettuce/) has more examples +and an API reference. You may also be interested in the +[Project Reactor](https://projectreactor.io/) library that Lettuce uses. -{{% alert title="Tip" color="warning" %}} -Choosing suitable timeout values is crucial for your application's performance and stability and is specific to each environment. -Configuring timeouts is only necessary if you have issues with the default values. -In some cases, the defaults are based on environment-specific settings (e.g., operating system settings), while in other cases, they are built into the Lettuce driver. -For more details on setting specific timeouts, see the [Lettuce reference guide](https://redis.github.io/lettuce/). -{{% /alert %}} - -Below is an example of setting socket-level timeouts. The `TCP_USER_TIMEOUT` setting is useful for scenarios where the server stops responding without acknowledging the last request, while the `KEEPALIVE` setting is good for detecting dead connections where there is no traffic between the client and the server. - -```java -RedisURI redisURI = RedisURI.Builder - .redis("localhost") - // set the global default from the default 60 seconds to 30 seconds - .withTimeout(Duration.ofSeconds(30)) - .build(); - -try (RedisClient client = RedisClient.create(redisURI)) { - // or set specific timeouts for things such as the TCP_USER_TIMEOUT and TCP_KEEPALIVE - - // A good general rule of thumb is to follow the rule - // TCP_USER_TIMEOUT = TCP_KEEP_IDLE+TCP_KEEPINTVL * TCP_KEEPCNT - // in this case, 20 = 5 + 5 * 3 - - SocketOptions.TcpUserTimeoutOptions tcpUserTimeout = SocketOptions.TcpUserTimeoutOptions.builder() - .tcpUserTimeout(Duration.ofSeconds(20)) - .enable().build(); - - SocketOptions.KeepAliveOptions keepAliveOptions = SocketOptions.KeepAliveOptions.builder() - .interval(Duration.ofSeconds(5)) - .idle(Duration.ofSeconds(5)) - .count(3).enable().build(); - - SocketOptions socketOptions = SocketOptions.builder() - .tcpUserTimeout(tcpUserTimeout) - .keepAlive(keepAliveOptions) - .build(); - - client.setOptions(ClientOptions.builder() - .socketOptions(socketOptions) - .build()); - - StatefulRedisConnection connection = client.connect(); - System.out.println(connection.sync().ping()); -} -``` - - -## DNS cache and Redis - -When you connect to a Redis server with multiple endpoints, such as [Redis Enterprise Active-Active](https://redis.com/redis-enterprise/technology/active-active-geo-distribution/), you *must* -disable the JVM's DNS cache. If a server node or proxy fails, the IP address for any database -affected by the failure will change. When this happens, your app will keep -trying to use the stale IP address if DNS caching is enabled. - -Use the following code to disable the DNS cache: - -```java -java.security.Security.setProperty("networkaddress.cache.ttl","0"); -java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0"); -``` - -## Learn more - -- [Lettuce reference documentation](https://redis.github.io/lettuce/) -- [Redis commands]({{< relref "/commands" >}}) -- [Project Reactor](https://projectreactor.io/) +See also the other pages in this section for more information and examples: diff --git a/content/develop/clients/lettuce/connect.md b/content/develop/clients/lettuce/connect.md index f4233a3bd1..ad04d1d9dc 100644 --- a/content/develop/clients/lettuce/connect.md +++ b/content/develop/clients/lettuce/connect.md @@ -46,7 +46,7 @@ public class ConnectBasicTest { } ``` -### Asynchronous connection +## Asynchronous connection ```java package org.example; @@ -89,7 +89,7 @@ public class Async { Learn more about asynchronous Lettuce API in [the reference guide](https://redis.github.io/lettuce/#asynchronous-api). -### Reactive connection +## Reactive connection ```java package org.example; diff --git a/content/develop/clients/lettuce/produsage.md b/content/develop/clients/lettuce/produsage.md new file mode 100644 index 0000000000..7931ccd63a --- /dev/null +++ b/content/develop/clients/lettuce/produsage.md @@ -0,0 +1,84 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Get your Lettuce app ready for production +linkTitle: Production usage +title: Production usage +weight: 3 +--- + +The following sections explain how to handle situations that may occur +in your production environment. + +## Timeouts + +Lettuce provides timeouts for many operations, such as command execution, SSL handshake, and Sentinel discovery. By default, Lettuce uses a global timeout value of 60 seconds for these operations, but you can override the global timeout value with individual timeout values for each operation. + +{{% alert title="Tip" color="warning" %}} +Choosing suitable timeout values is crucial for your application's performance and stability and is specific to each environment. +Configuring timeouts is only necessary if you have issues with the default values. +In some cases, the defaults are based on environment-specific settings (e.g., operating system settings), while in other cases, they are built into the Lettuce driver. +For more details on setting specific timeouts, see the [Lettuce reference guide](https://redis.github.io/lettuce/). +{{% /alert %}} + +Below is an example of setting socket-level timeouts. The `TCP_USER_TIMEOUT` setting is useful for scenarios where the server stops responding without acknowledging the last request, while the `KEEPALIVE` setting is good for detecting dead connections where there is no traffic between the client and the server. + +```java +RedisURI redisURI = RedisURI.Builder + .redis("localhost") + // set the global default from the default 60 seconds to 30 seconds + .withTimeout(Duration.ofSeconds(30)) + .build(); + +try (RedisClient client = RedisClient.create(redisURI)) { + // or set specific timeouts for things such as the TCP_USER_TIMEOUT and TCP_KEEPALIVE + + // A good general rule of thumb is to follow the rule + // TCP_USER_TIMEOUT = TCP_KEEP_IDLE+TCP_KEEPINTVL * TCP_KEEPCNT + // in this case, 20 = 5 + 5 * 3 + + SocketOptions.TcpUserTimeoutOptions tcpUserTimeout = SocketOptions.TcpUserTimeoutOptions.builder() + .tcpUserTimeout(Duration.ofSeconds(20)) + .enable().build(); + + SocketOptions.KeepAliveOptions keepAliveOptions = SocketOptions.KeepAliveOptions.builder() + .interval(Duration.ofSeconds(5)) + .idle(Duration.ofSeconds(5)) + .count(3).enable().build(); + + SocketOptions socketOptions = SocketOptions.builder() + .tcpUserTimeout(tcpUserTimeout) + .keepAlive(keepAliveOptions) + .build(); + + client.setOptions(ClientOptions.builder() + .socketOptions(socketOptions) + .build()); + + StatefulRedisConnection connection = client.connect(); + System.out.println(connection.sync().ping()); +} +``` + + +## DNS cache and Redis + +When you connect to a Redis server with multiple endpoints, such as [Redis Enterprise Active-Active](https://redis.com/redis-enterprise/technology/active-active-geo-distribution/), you *must* +disable the JVM's DNS cache. If a server node or proxy fails, the IP address for any database +affected by the failure will change. When this happens, your app will keep +trying to use the stale IP address if DNS caching is enabled. + +Use the following code to disable the DNS cache: + +```java +java.security.Security.setProperty("networkaddress.cache.ttl","0"); +java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0"); +``` From 747f50a789716c3791d797bc761eec94e7e815d8 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Thu, 7 Nov 2024 14:22:57 +0000 Subject: [PATCH 08/17] DOC-4543 split node-redis client page --- content/develop/clients/nodejs.md | 226 -------------------- content/develop/clients/nodejs/_index.md | 95 ++++++++ content/develop/clients/nodejs/connect.md | 129 +++++++++++ content/develop/clients/nodejs/produsage.md | 84 ++++++++ 4 files changed, 308 insertions(+), 226 deletions(-) delete mode 100644 content/develop/clients/nodejs.md create mode 100644 content/develop/clients/nodejs/_index.md create mode 100644 content/develop/clients/nodejs/connect.md create mode 100644 content/develop/clients/nodejs/produsage.md diff --git a/content/develop/clients/nodejs.md b/content/develop/clients/nodejs.md deleted file mode 100644 index a668ba0254..0000000000 --- a/content/develop/clients/nodejs.md +++ /dev/null @@ -1,226 +0,0 @@ ---- -categories: -- docs -- develop -- stack -- oss -- rs -- rc -- oss -- kubernetes -- clients -description: Connect your Node.js application to a Redis database -linkTitle: node-redis (Node.js) -title: node-redis guide (Node.js) -weight: 4 ---- - -[node-redis](https://github.com/redis/node-redis) is the Redis client for Node.js. -The sections below explain how to install `node-redis` and connect your application -to a Redis database. - -`node-redis` requires a running Redis or [Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation instructions. - -You can also access Redis with an object-mapping client interface. See -[RedisOM for Node.js]({{< relref "/integrate/redisom-for-node-js" >}}) -for more information. - -## Install - -To install node-redis, run: - -```bash -npm install redis -``` - -## Connect - -Connect to localhost on port 6379. - -```js -import { createClient } from 'redis'; - -const client = createClient(); - -client.on('error', err => console.log('Redis Client Error', err)); - -await client.connect(); -``` - -Store and retrieve a simple string. - -```js -await client.set('key', 'value'); -const value = await client.get('key'); -``` - -Store and retrieve a map. - -```js -await client.hSet('user-session:123', { - name: 'John', - surname: 'Smith', - company: 'Redis', - age: 29 -}) - -let userSession = await client.hGetAll('user-session:123'); -console.log(JSON.stringify(userSession, null, 2)); -/* -{ - "surname": "Smith", - "name": "John", - "company": "Redis", - "age": "29" -} - */ -``` - -To connect to a different host or port, use a connection string in the format `redis[s]://[[username][:password]@][host][:port][/db-number]`: - -```js -createClient({ - url: 'redis://alice:foobared@awesome.redis.server:6380' -}); -``` -To check if the client is connected and ready to send commands, use `client.isReady`, which returns a Boolean. `client.isOpen` is also available. This returns `true` when the client's underlying socket is open, and `false` when it isn't (for example, when the client is still connecting or reconnecting after a network error). - -### Connect to a Redis cluster - -To connect to a Redis cluster, use `createCluster`. - -```js -import { createCluster } from 'redis'; - -const cluster = createCluster({ - rootNodes: [ - { - url: 'redis://127.0.0.1:16379' - }, - { - url: 'redis://127.0.0.1:16380' - }, - // ... - ] -}); - -cluster.on('error', (err) => console.log('Redis Cluster Error', err)); - -await cluster.connect(); - -await cluster.set('foo', 'bar'); -const value = await cluster.get('foo'); -console.log(value); // returns 'bar' - -await cluster.quit(); -``` - -### Connect to your production Redis with TLS - -When you deploy your application, use TLS and follow the [Redis security]({{< relref "/operate/oss_and_stack/management/security/" >}}) guidelines. - -```js -const client = createClient({ - username: 'default', // use your Redis user. More info https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/ - password: 'secret', // use your password here - socket: { - host: 'my-redis.cloud.redislabs.com', - port: 6379, - tls: true, - key: readFileSync('./redis_user_private.key'), - cert: readFileSync('./redis_user.crt'), - ca: [readFileSync('./redis_ca.pem')] - } -}); - -client.on('error', (err) => console.log('Redis Client Error', err)); - -await client.connect(); - -await client.set('foo', 'bar'); -const value = await client.get('foo'); -console.log(value) // returns 'bar' - -await client.disconnect(); -``` - -You can also use discrete parameters and UNIX sockets. Details can be found in the [client configuration guide](https://github.com/redis/node-redis/blob/master/docs/client-configuration.md). - -## Production usage - -The following sections explain how to handle situations that may occur -in your production environment. - -### Handling errors - -Node-Redis provides [multiple events to handle various scenarios](https://github.com/redis/node-redis?tab=readme-ov-file#events), among which the most critical is the `error` event. - -This event is triggered whenever an error occurs within the client. - -It is crucial to listen for error events. - -If a client does not register at least one error listener and an error occurs, the system will throw that error, potentially causing the Node.js process to exit unexpectedly. -See [the EventEmitter docs](https://nodejs.org/api/events.html#events_error_events) for more details. - -```typescript -const client = createClient({ - // ... client options -}); -// Always ensure there's a listener for errors in the client to prevent process crashes due to unhandled errors -client.on('error', error => { - console.error(`Redis client error:`, error); -}); -``` - -### Handling reconnections - -If network issues or other problems unexpectedly close the socket, the client will reject all commands already sent, since the server might have already executed them. -The rest of the pending commands will remain queued in memory until a new socket is established. -This behaviour is controlled by the `enableOfflineQueue` option, which is enabled by default. - -The client uses `reconnectStrategy` to decide when to attempt to reconnect. -The default strategy is to calculate the delay before each attempt based on the attempt number `Math.min(retries * 50, 500)`. You can customize this strategy by passing a supported value to `reconnectStrategy` option: - - -1. Define a callback `(retries: number, cause: Error) => false | number | Error` **(recommended)** -```typescript -const client = createClient({ - socket: { - reconnectStrategy: function(retries) { - if (retries > 20) { - console.log("Too many attempts to reconnect. Redis connection was terminated"); - return new Error("Too many retries."); - } else { - return retries * 500; - } - } - } -}); -client.on('error', error => console.error('Redis client error:', error)); -``` -In the provided reconnection strategy callback, the client attempts to reconnect up to 20 times with a delay of `retries * 500` milliseconds between attempts. -After approximately two minutes, the client logs an error message and terminates the connection if the maximum retry limit is exceeded. - - -2. Use a numerical value to set a fixed delay in milliseconds. -3. Use `false` to disable reconnection attempts. This option should only be used for testing purposes. - -### Timeouts - -To set a timeout for a connection, use the `connectTimeout` option: -```typescript -const client = createClient({ - // setting a 10-second timeout - connectTimeout: 10000 // in milliseconds -}); -client.on('error', error => console.error('Redis client error:', error)); -``` - -## Learn more - -* [Node-Redis Configuration Options](https://github.com/redis/node-redis/blob/master/docs/client-configuration.md) -* [Redis commands](https://redis.js.org/#node-redis-usage-redis-commands) -* [Programmability](https://redis.js.org/#node-redis-usage-programmability) -* [Clustering](https://redis.js.org/#node-redis-usage-clustering) -* [GitHub](https://github.com/redis/node-redis) - diff --git a/content/develop/clients/nodejs/_index.md b/content/develop/clients/nodejs/_index.md new file mode 100644 index 0000000000..0a9eaf12b2 --- /dev/null +++ b/content/develop/clients/nodejs/_index.md @@ -0,0 +1,95 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your Node.js application to a Redis database +linkTitle: node-redis (Node.js) +title: node-redis guide (Node.js) +weight: 4 +--- + +[node-redis](https://github.com/redis/node-redis) is the Redis client for Node.js. +The sections below explain how to install `node-redis` and connect your application +to a Redis database. + +`node-redis` requires a running Redis or [Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation instructions. + +You can also access Redis with an object-mapping client interface. See +[RedisOM for Node.js]({{< relref "/integrate/redisom-for-node-js" >}}) +for more information. + +## Install + +To install node-redis, run: + +```bash +npm install redis +``` + +## Connect and test + +Connect to localhost on port 6379. + +```js +import { createClient } from 'redis'; + +const client = createClient(); + +client.on('error', err => console.log('Redis Client Error', err)); + +await client.connect(); +``` + +Store and retrieve a simple string. + +```js +await client.set('key', 'value'); +const value = await client.get('key'); +``` + +Store and retrieve a map. + +```js +await client.hSet('user-session:123', { + name: 'John', + surname: 'Smith', + company: 'Redis', + age: 29 +}) + +let userSession = await client.hGetAll('user-session:123'); +console.log(JSON.stringify(userSession, null, 2)); +/* +{ + "surname": "Smith", + "name": "John", + "company": "Redis", + "age": "29" +} + */ +``` + +To connect to a different host or port, use a connection string in the format `redis[s]://[[username][:password]@][host][:port][/db-number]`: + +```js +createClient({ + url: 'redis://alice:foobared@awesome.redis.server:6380' +}); +``` +To check if the client is connected and ready to send commands, use `client.isReady`, which returns a Boolean. `client.isOpen` is also available. This returns `true` when the client's underlying socket is open, and `false` when it isn't (for example, when the client is still connecting or reconnecting after a network error). + +## More information + +The [`node-redis` website](https://redis.js.org/) has more examples. +The [Github repository](https://github.com/redis/node-redis) also has useful +information, including a guide to the +[connection configuration options](https://github.com/redis/node-redis/blob/master/docs/client-configuration.md) you can use. + +See also the other pages in this section for more information and examples: diff --git a/content/develop/clients/nodejs/connect.md b/content/develop/clients/nodejs/connect.md new file mode 100644 index 0000000000..cb1d11e739 --- /dev/null +++ b/content/develop/clients/nodejs/connect.md @@ -0,0 +1,129 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your Node.js application to a Redis database +linkTitle: Connect +title: Connect to the server +weight: 2 +--- + +## Basic connection + +Connect to localhost on port 6379. + +```js +import { createClient } from 'redis'; + +const client = createClient(); + +client.on('error', err => console.log('Redis Client Error', err)); + +await client.connect(); +``` + +Store and retrieve a simple string. + +```js +await client.set('key', 'value'); +const value = await client.get('key'); +``` + +Store and retrieve a map. + +```js +await client.hSet('user-session:123', { + name: 'John', + surname: 'Smith', + company: 'Redis', + age: 29 +}) + +let userSession = await client.hGetAll('user-session:123'); +console.log(JSON.stringify(userSession, null, 2)); +/* +{ + "surname": "Smith", + "name": "John", + "company": "Redis", + "age": "29" +} + */ +``` + +To connect to a different host or port, use a connection string in the format `redis[s]://[[username][:password]@][host][:port][/db-number]`: + +```js +createClient({ + url: 'redis://alice:foobared@awesome.redis.server:6380' +}); +``` +To check if the client is connected and ready to send commands, use `client.isReady`, which returns a Boolean. `client.isOpen` is also available. This returns `true` when the client's underlying socket is open, and `false` when it isn't (for example, when the client is still connecting or reconnecting after a network error). + +### Connect to a Redis cluster + +To connect to a Redis cluster, use `createCluster`. + +```js +import { createCluster } from 'redis'; + +const cluster = createCluster({ + rootNodes: [ + { + url: 'redis://127.0.0.1:16379' + }, + { + url: 'redis://127.0.0.1:16380' + }, + // ... + ] +}); + +cluster.on('error', (err) => console.log('Redis Cluster Error', err)); + +await cluster.connect(); + +await cluster.set('foo', 'bar'); +const value = await cluster.get('foo'); +console.log(value); // returns 'bar' + +await cluster.quit(); +``` + +### Connect to your production Redis with TLS + +When you deploy your application, use TLS and follow the [Redis security]({{< relref "/operate/oss_and_stack/management/security/" >}}) guidelines. + +```js +const client = createClient({ + username: 'default', // use your Redis user. More info https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/ + password: 'secret', // use your password here + socket: { + host: 'my-redis.cloud.redislabs.com', + port: 6379, + tls: true, + key: readFileSync('./redis_user_private.key'), + cert: readFileSync('./redis_user.crt'), + ca: [readFileSync('./redis_ca.pem')] + } +}); + +client.on('error', (err) => console.log('Redis Client Error', err)); + +await client.connect(); + +await client.set('foo', 'bar'); +const value = await client.get('foo'); +console.log(value) // returns 'bar' + +await client.disconnect(); +``` + +You can also use discrete parameters and UNIX sockets. Details can be found in the [client configuration guide](https://github.com/redis/node-redis/blob/master/docs/client-configuration.md). diff --git a/content/develop/clients/nodejs/produsage.md b/content/develop/clients/nodejs/produsage.md new file mode 100644 index 0000000000..32be48680a --- /dev/null +++ b/content/develop/clients/nodejs/produsage.md @@ -0,0 +1,84 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Get your Node.js app ready for production +linkTitle: Production usage +title: Production usage +weight: 3 +--- + +The following sections explain how to handle situations that may occur +in your production environment. + +### Handling errors + +Node-Redis provides [multiple events to handle various scenarios](https://github.com/redis/node-redis?tab=readme-ov-file#events), among which the most critical is the `error` event. + +This event is triggered whenever an error occurs within the client. + +It is crucial to listen for error events. + +If a client does not register at least one error listener and an error occurs, the system will throw that error, potentially causing the Node.js process to exit unexpectedly. +See [the EventEmitter docs](https://nodejs.org/api/events.html#events_error_events) for more details. + +```typescript +const client = createClient({ + // ... client options +}); +// Always ensure there's a listener for errors in the client to prevent process crashes due to unhandled errors +client.on('error', error => { + console.error(`Redis client error:`, error); +}); +``` + +### Handling reconnections + +If network issues or other problems unexpectedly close the socket, the client will reject all commands already sent, since the server might have already executed them. +The rest of the pending commands will remain queued in memory until a new socket is established. +This behaviour is controlled by the `enableOfflineQueue` option, which is enabled by default. + +The client uses `reconnectStrategy` to decide when to attempt to reconnect. +The default strategy is to calculate the delay before each attempt based on the attempt number `Math.min(retries * 50, 500)`. You can customize this strategy by passing a supported value to `reconnectStrategy` option: + + +1. Define a callback `(retries: number, cause: Error) => false | number | Error` **(recommended)** +```typescript +const client = createClient({ + socket: { + reconnectStrategy: function(retries) { + if (retries > 20) { + console.log("Too many attempts to reconnect. Redis connection was terminated"); + return new Error("Too many retries."); + } else { + return retries * 500; + } + } + } +}); +client.on('error', error => console.error('Redis client error:', error)); +``` +In the provided reconnection strategy callback, the client attempts to reconnect up to 20 times with a delay of `retries * 500` milliseconds between attempts. +After approximately two minutes, the client logs an error message and terminates the connection if the maximum retry limit is exceeded. + + +2. Use a numerical value to set a fixed delay in milliseconds. +3. Use `false` to disable reconnection attempts. This option should only be used for testing purposes. + +### Timeouts + +To set a timeout for a connection, use the `connectTimeout` option: +```typescript +const client = createClient({ + // setting a 10-second timeout + connectTimeout: 10000 // in milliseconds +}); +client.on('error', error => console.error('Redis client error:', error)); +``` \ No newline at end of file From 2cc8c0bcad0686309da4e26d225fa94eebe0284b Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Thu, 7 Nov 2024 14:30:08 +0000 Subject: [PATCH 09/17] DOC-4543 split PHP client page --- content/develop/clients/php.md | 308 ----------------------- content/develop/clients/php/_index.md | 90 +++++++ content/develop/clients/php/connect.md | 143 +++++++++++ content/develop/clients/php/queryjson.md | 153 +++++++++++ 4 files changed, 386 insertions(+), 308 deletions(-) delete mode 100644 content/develop/clients/php.md create mode 100644 content/develop/clients/php/_index.md create mode 100644 content/develop/clients/php/connect.md create mode 100644 content/develop/clients/php/queryjson.md diff --git a/content/develop/clients/php.md b/content/develop/clients/php.md deleted file mode 100644 index 3cbb081dc3..0000000000 --- a/content/develop/clients/php.md +++ /dev/null @@ -1,308 +0,0 @@ ---- -categories: -- docs -- develop -- stack -- oss -- rs -- rc -- oss -- kubernetes -- clients -description: Connect your PHP application to a Redis database -linkTitle: Predis (PHP) -title: Predis guide (PHP) -weight: 8 ---- - -[`Predis`](https://github.com/predis/predis) is the recommended [PHP](https://php.net/) -client for Redis. -The sections below explain how to install `Predis` and connect your application to a Redis database. - -{{< note >}}Although we provide basic documentation for `Predis`, it is a third-party -client library and is not developed or supported directly by Redis. -{{< /note >}} - -`Predis` requires a running Redis or -[Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. -See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation -instructions. - -## Install - -Use [Composer](https://getcomposer.org/) to install the `Predis` library -with the following command line: - -```bash -composer require predis/predis -``` - -## Connect - -Connect to a locally-running server on the standard port (6379) -with the following code: - -```php -set('foo', 'bar'), PHP_EOL; -// >>> OK - -echo $r->get('foo'), PHP_EOL; -// >>> bar -``` - -Store and retrieve a [hash]({{< relref "/develop/data-types/hashes" >}}) -object: - -```php -$r->hset('user-session:123', 'name', 'John'); -$r->hset('user-session:123', 'surname', 'Smith'); -$r->hset('user-session:123', 'company', 'Redis'); -$r->hset('user-session:123', 'age', 29); - -echo var_export($r->hgetall('user-session:123')), PHP_EOL; -/* >>> -array ( - 'name' => 'John', - 'surname' => 'Smith', - 'company' => 'Redis', - 'age' => '29', -) -*/ -``` - -## Connect to a Redis cluster - -To connect to a Redis cluster, specify one or more of the nodes in -the `clusterNodes` parameter and set `'cluster'=>'redis'` in -`options`: - -```php -$clusterNodes = [ - 'tcp://127.0.0.1:30001', // Node 1 - 'tcp://127.0.0.1:30002', // Node 2 - 'tcp://127.0.0.1:30003', // Node 3 -]; -$options = ['cluster' => 'redis']; - -// Create a Predis client for the cluster -$rc = new PredisClient($clusterNodes, $options); - -echo $rc->cluster('nodes'), PHP_EOL; -/* >>> -d8773e888e92d015b7c52fc66798fd6815afefec 127.0.0.1:30004@40004 slave cde97d1f7dce13e9253ace5cafd3fb0aa67cda63 0 1730713764217 1 connected -58fe1346de4c425d60db24e9b153926fbde0d174 127.0.0.1:30002@40002 master - 0 1730713763361 2 connected 5461-10922 -015ecc8148a05377dda22f19921d16efcdd6d678 127.0.0.1:30006@40006 slave c019b75d8b52e83e7e52724eccc716ac553f71d6 0 1730713764218 3 connected -aca365963a72642e6ae0c9503aabf3be5c260806 127.0.0.1:30005@40005 slave 58fe1346de4c425d60db24e9b153926fbde0d174 0 1730713763363 2 connected -c019b75d8b52e83e7e52724eccc716ac553f71d6 127.0.0.1:30003@40003 myself,master - 0 1730713764000 3 connected 10923-16383 -cde97d1f7dce13e9253ace5cafd3fb0aa67cda63 127.0.0.1:30001@40001 master - 0 1730713764113 1 connected 0-5460 -*/ - -echo $rc->set('foo', 'bar'), PHP_EOL; -// >>> OK -echo $rc->get('foo'), PHP_EOL; -// >>> bar -``` - -## Connect to your production Redis with TLS - -When you deploy your application, use TLS and follow the -[Redis security]({{< relref "/operate/oss_and_stack/management/security/" >}}) -guidelines. - -Use the following commands to generate the client certificate and private key: - -```bash -openssl genrsa -out redis_user_private.key 2048 -openssl req -new -key redis_user_private.key -out redis_user.csr -openssl x509 -req -days 365 -in redis_user.csr -signkey redis_user_private.key -out redis_user.crt -``` - -If you have the [Redis source folder](https://github.com/redis/redis) available, -you can also generate the certificate and private key with these commands: - -```bash -./utils/gen-test-certs.sh -./src/redis-server --tls-port 6380 --port 0 --tls-cert-file ./tests/tls/redis.crt --tls-key-file ./tests/tls/redis.key --tls-ca-cert-file ./tests/tls/ca.crt -``` - -Pass this information during connection using the `ssl` section of `options`: - -```php -$options = [ - 'scheme' => 'tls', // Use 'tls' for SSL connections - 'host' => '127.0.0.1', // Redis server hostname - 'port' => 6379, // Redis server port - 'username' => 'default', // Redis username - 'password' => '', // Redis password - 'options' => [ - 'ssl' => [ - 'verify_peer' => true, // Verify the server's SSL certificate - 'cafile' => './redis_ca.pem', // Path to CA certificate - 'local_cert' => './redis_user.crt', // Path to client certificate - 'local_pk' => './redis_user_private.key', // Path to client private key - ], - ], -]; - -$tlsConnection = new PredisClient($options); - -echo $tlsConnection->set('foo', 'bar'), PHP_EOL; -// >>> OK -echo $tlsConnection->get('foo'), PHP_EOL; -// >>> bar -``` - -## Example: Indexing and querying JSON documents - -This example shows how to index and query Redis JSON data using `predis`. - -Make sure that you have Redis Stack and `predis` installed, as described -in the [Install](#install) section above. - -Start by importing dependencies: - -```php - 'tcp', - 'host' => '127.0.0.1', - 'port' => 6379, - 'password' => '', - 'database' => 0, - ]); -``` - -Create some test data to add to the database: - -```php -$user1 = json_encode([ - 'name' => 'Paul John', - 'email' => 'paul.john@example.com', - 'age' => 42, - 'city' => 'London', -], JSON_THROW_ON_ERROR); - -$user2 = json_encode([ - 'name' => 'Eden Zamir', - 'email' => 'eden.zamir@example.com', - 'age' => 29, - 'city' => 'Tel Aviv', -], JSON_THROW_ON_ERROR); - -$user3 = json_encode([ - 'name' => 'Paul Zamir', - 'email' => 'paul.zamir@example.com', - 'age' => 35, - 'city' => 'Tel Aviv', -], JSON_THROW_ON_ERROR); -``` - -Create an -[index]({{< relref "/develop/interact/search-and-query/indexing" >}}). -In this example, only JSON documents with the key prefix `user:` are indexed. -For more information, see -[Query syntax]({{< relref "/develop/interact/search-and-query/query/" >}}). - -```php -$schema = [ - new TextField('$.name', 'name'), - new TagField('$.city', 'city'), - new NumericField('$.age', "age"), -]; - -try { -$r->ftCreate("idx:users", $schema, - (new CreateArguments()) - ->on('JSON') - ->prefix(["user:"])); -} -catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; -} -``` - -Add the three sets of user data to the database as -[JSON]({{< relref "/develop/data-types/json" >}}) objects. -If you use keys with the `user:` prefix then Redis will index the -objects automatically as you add them: - -```php -$r->jsonset('user:1', '$', $user1); -$r->jsonset('user:2', '$', $user2); -$r->jsonset('user:3', '$', $user3); -``` - -You can now use the index to search the JSON objects. The -[query]({{< relref "/develop/interact/search-and-query/query" >}}) -below searches for objects that have the text "Paul" in any field -and have an `age` value in the range 30 to 40: - -```php -$res = $r->ftSearch("idx:users", "Paul @age:[30 40]"); -echo json_encode($res), PHP_EOL; -// >>> [1,"user:3",["$","{\"name\":\"Paul Zamir\",\"email\":\"paul.zamir@example.com\",\"age\":35,\"city\":\"London\"}"]] -``` - -Specify query options to return only the `city` field: - -```php -$arguments = new SearchArguments(); -$arguments->addReturn(3, '$.city', true, 'thecity'); -$arguments->dialect(2); -$arguments->limit(0, 5); - -$res = $r->ftSearch("idx:users", "Paul", $arguments); - -echo json_encode($res), PHP_EOL; -// >>> [2,"user:1",["thecity","London"],"user:3",["thecity","Tel Aviv"]] -``` - -Use an -[aggregation query]({{< relref "/develop/interact/search-and-query/query/aggregation" >}}) -to count all users in each city. - -```php -$ftAggregateArguments = (new AggregateArguments()) -->groupBy('@city') -->reduce('COUNT', true, 'count'); - -$res = $r->ftAggregate('idx:users', '*', $ftAggregateArguments); -echo json_encode($res), PHP_EOL; -// >>> [2,["city","London","count","1"],["city","Tel Aviv","count","2"]] -``` - -See the [Redis query engine]({{< relref "/develop/interact/search-and-query" >}}) docs -for a full description of all query features with examples. - -## Learn more - -- [Predis wiki on Github](https://github.com/predis/predis/wiki) diff --git a/content/develop/clients/php/_index.md b/content/develop/clients/php/_index.md new file mode 100644 index 0000000000..bea818294b --- /dev/null +++ b/content/develop/clients/php/_index.md @@ -0,0 +1,90 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your PHP application to a Redis database +linkTitle: Predis (PHP) +title: Predis guide (PHP) +weight: 8 +--- + +[`Predis`](https://github.com/predis/predis) is the recommended [PHP](https://php.net/) +client for Redis. +The sections below explain how to install `Predis` and connect your application to a Redis database. + +{{< note >}}Although we provide basic documentation for `Predis`, it is a third-party +client library and is not developed or supported directly by Redis. +{{< /note >}} + +`Predis` requires a running Redis or +[Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) server. +See [Getting started]({{< relref "/operate/oss_and_stack/install/" >}}) for Redis installation +instructions. + +## Install + +Use [Composer](https://getcomposer.org/) to install the `Predis` library +with the following command line: + +```bash +composer require predis/predis +``` + +## Connect and test + +Connect to a locally-running server on the standard port (6379) +with the following code: + +```php +set('foo', 'bar'), PHP_EOL; +// >>> OK + +echo $r->get('foo'), PHP_EOL; +// >>> bar +``` + +Store and retrieve a [hash]({{< relref "/develop/data-types/hashes" >}}) +object: + +```php +$r->hset('user-session:123', 'name', 'John'); +$r->hset('user-session:123', 'surname', 'Smith'); +$r->hset('user-session:123', 'company', 'Redis'); +$r->hset('user-session:123', 'age', 29); + +echo var_export($r->hgetall('user-session:123')), PHP_EOL; +/* >>> +array ( + 'name' => 'John', + 'surname' => 'Smith', + 'company' => 'Redis', + 'age' => '29', +) +*/ +``` + +## More information + +The [Predis wiki on Github](https://github.com/predis/predis/wiki) has +information about the different connection options you can use. + +See also the pages in this section for more information and examples: diff --git a/content/develop/clients/php/connect.md b/content/develop/clients/php/connect.md new file mode 100644 index 0000000000..97352654be --- /dev/null +++ b/content/develop/clients/php/connect.md @@ -0,0 +1,143 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Connect your PHP application to a Redis database +linkTitle: Connect +title: Connect to the server +weight: 2 +--- + +## Basic connection + +Connect to a locally-running server on the standard port (6379) +with the following code: + +```php +set('foo', 'bar'), PHP_EOL; +// >>> OK + +echo $r->get('foo'), PHP_EOL; +// >>> bar +``` + +Store and retrieve a [hash]({{< relref "/develop/data-types/hashes" >}}) +object: + +```php +$r->hset('user-session:123', 'name', 'John'); +$r->hset('user-session:123', 'surname', 'Smith'); +$r->hset('user-session:123', 'company', 'Redis'); +$r->hset('user-session:123', 'age', 29); + +echo var_export($r->hgetall('user-session:123')), PHP_EOL; +/* >>> +array ( + 'name' => 'John', + 'surname' => 'Smith', + 'company' => 'Redis', + 'age' => '29', +) +*/ +``` + +## Connect to a Redis cluster + +To connect to a Redis cluster, specify one or more of the nodes in +the `clusterNodes` parameter and set `'cluster'=>'redis'` in +`options`: + +```php +$clusterNodes = [ + 'tcp://127.0.0.1:30001', // Node 1 + 'tcp://127.0.0.1:30002', // Node 2 + 'tcp://127.0.0.1:30003', // Node 3 +]; +$options = ['cluster' => 'redis']; + +// Create a Predis client for the cluster +$rc = new PredisClient($clusterNodes, $options); + +echo $rc->cluster('nodes'), PHP_EOL; +/* >>> +d8773e888e92d015b7c52fc66798fd6815afefec 127.0.0.1:30004@40004 slave cde97d1f7dce13e9253ace5cafd3fb0aa67cda63 0 1730713764217 1 connected +58fe1346de4c425d60db24e9b153926fbde0d174 127.0.0.1:30002@40002 master - 0 1730713763361 2 connected 5461-10922 +015ecc8148a05377dda22f19921d16efcdd6d678 127.0.0.1:30006@40006 slave c019b75d8b52e83e7e52724eccc716ac553f71d6 0 1730713764218 3 connected +aca365963a72642e6ae0c9503aabf3be5c260806 127.0.0.1:30005@40005 slave 58fe1346de4c425d60db24e9b153926fbde0d174 0 1730713763363 2 connected +c019b75d8b52e83e7e52724eccc716ac553f71d6 127.0.0.1:30003@40003 myself,master - 0 1730713764000 3 connected 10923-16383 +cde97d1f7dce13e9253ace5cafd3fb0aa67cda63 127.0.0.1:30001@40001 master - 0 1730713764113 1 connected 0-5460 +*/ + +echo $rc->set('foo', 'bar'), PHP_EOL; +// >>> OK +echo $rc->get('foo'), PHP_EOL; +// >>> bar +``` + +## Connect to your production Redis with TLS + +When you deploy your application, use TLS and follow the +[Redis security]({{< relref "/operate/oss_and_stack/management/security/" >}}) +guidelines. + +Use the following commands to generate the client certificate and private key: + +```bash +openssl genrsa -out redis_user_private.key 2048 +openssl req -new -key redis_user_private.key -out redis_user.csr +openssl x509 -req -days 365 -in redis_user.csr -signkey redis_user_private.key -out redis_user.crt +``` + +If you have the [Redis source folder](https://github.com/redis/redis) available, +you can also generate the certificate and private key with these commands: + +```bash +./utils/gen-test-certs.sh +./src/redis-server --tls-port 6380 --port 0 --tls-cert-file ./tests/tls/redis.crt --tls-key-file ./tests/tls/redis.key --tls-ca-cert-file ./tests/tls/ca.crt +``` + +Pass this information during connection using the `ssl` section of `options`: + +```php +$options = [ + 'scheme' => 'tls', // Use 'tls' for SSL connections + 'host' => '127.0.0.1', // Redis server hostname + 'port' => 6379, // Redis server port + 'username' => 'default', // Redis username + 'password' => '', // Redis password + 'options' => [ + 'ssl' => [ + 'verify_peer' => true, // Verify the server's SSL certificate + 'cafile' => './redis_ca.pem', // Path to CA certificate + 'local_cert' => './redis_user.crt', // Path to client certificate + 'local_pk' => './redis_user_private.key', // Path to client private key + ], + ], +]; + +$tlsConnection = new PredisClient($options); + +echo $tlsConnection->set('foo', 'bar'), PHP_EOL; +// >>> OK +echo $tlsConnection->get('foo'), PHP_EOL; +// >>> bar +``` \ No newline at end of file diff --git a/content/develop/clients/php/queryjson.md b/content/develop/clients/php/queryjson.md new file mode 100644 index 0000000000..67ed7a6c79 --- /dev/null +++ b/content/develop/clients/php/queryjson.md @@ -0,0 +1,153 @@ +--- +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +description: Learn how to use the Redis query engine with JSON +linkTitle: JSON query example +title: Example - Index and query JSON documents +weight: 2 +--- + +This example shows how to index and query Redis JSON data using `predis`. + +Make sure that you have Redis Stack and `predis` installed, as described +in the [Install](#install) section above. + +Start by importing dependencies: + +```php + 'tcp', + 'host' => '127.0.0.1', + 'port' => 6379, + 'password' => '', + 'database' => 0, + ]); +``` + +Create some test data to add to the database: + +```php +$user1 = json_encode([ + 'name' => 'Paul John', + 'email' => 'paul.john@example.com', + 'age' => 42, + 'city' => 'London', +], JSON_THROW_ON_ERROR); + +$user2 = json_encode([ + 'name' => 'Eden Zamir', + 'email' => 'eden.zamir@example.com', + 'age' => 29, + 'city' => 'Tel Aviv', +], JSON_THROW_ON_ERROR); + +$user3 = json_encode([ + 'name' => 'Paul Zamir', + 'email' => 'paul.zamir@example.com', + 'age' => 35, + 'city' => 'Tel Aviv', +], JSON_THROW_ON_ERROR); +``` + +Create an +[index]({{< relref "/develop/interact/search-and-query/indexing" >}}). +In this example, only JSON documents with the key prefix `user:` are indexed. +For more information, see +[Query syntax]({{< relref "/develop/interact/search-and-query/query/" >}}). + +```php +$schema = [ + new TextField('$.name', 'name'), + new TagField('$.city', 'city'), + new NumericField('$.age', "age"), +]; + +try { +$r->ftCreate("idx:users", $schema, + (new CreateArguments()) + ->on('JSON') + ->prefix(["user:"])); +} +catch (Exception $e) { + echo $e->getMessage(), PHP_EOL; +} +``` + +Add the three sets of user data to the database as +[JSON]({{< relref "/develop/data-types/json" >}}) objects. +If you use keys with the `user:` prefix then Redis will index the +objects automatically as you add them: + +```php +$r->jsonset('user:1', '$', $user1); +$r->jsonset('user:2', '$', $user2); +$r->jsonset('user:3', '$', $user3); +``` + +You can now use the index to search the JSON objects. The +[query]({{< relref "/develop/interact/search-and-query/query" >}}) +below searches for objects that have the text "Paul" in any field +and have an `age` value in the range 30 to 40: + +```php +$res = $r->ftSearch("idx:users", "Paul @age:[30 40]"); +echo json_encode($res), PHP_EOL; +// >>> [1,"user:3",["$","{\"name\":\"Paul Zamir\",\"email\":\"paul.zamir@example.com\",\"age\":35,\"city\":\"London\"}"]] +``` + +Specify query options to return only the `city` field: + +```php +$arguments = new SearchArguments(); +$arguments->addReturn(3, '$.city', true, 'thecity'); +$arguments->dialect(2); +$arguments->limit(0, 5); + +$res = $r->ftSearch("idx:users", "Paul", $arguments); + +echo json_encode($res), PHP_EOL; +// >>> [2,"user:1",["thecity","London"],"user:3",["thecity","Tel Aviv"]] +``` + +Use an +[aggregation query]({{< relref "/develop/interact/search-and-query/query/aggregation" >}}) +to count all users in each city. + +```php +$ftAggregateArguments = (new AggregateArguments()) +->groupBy('@city') +->reduce('COUNT', true, 'count'); + +$res = $r->ftAggregate('idx:users', '*', $ftAggregateArguments); +echo json_encode($res), PHP_EOL; +// >>> [2,["city","London","count","1"],["city","Tel Aviv","count","2"]] +``` + +See the [Redis query engine]({{< relref "/develop/interact/search-and-query" >}}) docs +for a full description of all query features with examples. From 0d555ea60ca6f612e54cf7eef464aaeb5be328a1 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Fri, 8 Nov 2024 15:52:43 +0000 Subject: [PATCH 10/17] DOC-4543 added aliases to client pages --- content/develop/clients/_index.md | 1 + content/develop/clients/client-side-caching.md | 1 + content/develop/clients/dotnet/_index.md | 1 + content/develop/clients/go/_index.md | 1 + content/develop/clients/jedis/_index.md | 1 + content/develop/clients/lettuce/_index.md | 1 + content/develop/clients/nodejs/_index.md | 1 + content/develop/clients/php/_index.md | 1 + content/develop/clients/pools-and-muxing.md | 1 + content/develop/clients/redis-py/_index.md | 1 + content/develop/clients/redis-vl.md | 1 + 11 files changed, 11 insertions(+) diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index 1d3e7ba8df..3921971b94 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients categories: - docs - develop diff --git a/content/develop/clients/client-side-caching.md b/content/develop/clients/client-side-caching.md index 115631730b..85171c536b 100644 --- a/content/develop/clients/client-side-caching.md +++ b/content/develop/clients/client-side-caching.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/client-side-caching categories: - docs - develop diff --git a/content/develop/clients/dotnet/_index.md b/content/develop/clients/dotnet/_index.md index 49e8b5d848..e1dd60f62a 100644 --- a/content/develop/clients/dotnet/_index.md +++ b/content/develop/clients/dotnet/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/dotnet categories: - docs - develop diff --git a/content/develop/clients/go/_index.md b/content/develop/clients/go/_index.md index 2891a32c39..690f449a2e 100644 --- a/content/develop/clients/go/_index.md +++ b/content/develop/clients/go/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/go categories: - docs - develop diff --git a/content/develop/clients/jedis/_index.md b/content/develop/clients/jedis/_index.md index 2e4a124c2d..b3fbc8a462 100644 --- a/content/develop/clients/jedis/_index.md +++ b/content/develop/clients/jedis/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/java/jedis categories: - docs - develop diff --git a/content/develop/clients/lettuce/_index.md b/content/develop/clients/lettuce/_index.md index f60531d092..0b6b85c063 100644 --- a/content/develop/clients/lettuce/_index.md +++ b/content/develop/clients/lettuce/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/java/lettuce categories: - docs - develop diff --git a/content/develop/clients/nodejs/_index.md b/content/develop/clients/nodejs/_index.md index 0a9eaf12b2..0fea8e6088 100644 --- a/content/develop/clients/nodejs/_index.md +++ b/content/develop/clients/nodejs/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/nodejs categories: - docs - develop diff --git a/content/develop/clients/php/_index.md b/content/develop/clients/php/_index.md index bea818294b..2511caf498 100644 --- a/content/develop/clients/php/_index.md +++ b/content/develop/clients/php/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/php categories: - docs - develop diff --git a/content/develop/clients/pools-and-muxing.md b/content/develop/clients/pools-and-muxing.md index d634bd6019..11d91b7ca3 100644 --- a/content/develop/clients/pools-and-muxing.md +++ b/content/develop/clients/pools-and-muxing.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/pools-and-muxing categories: - docs - develop diff --git a/content/develop/clients/redis-py/_index.md b/content/develop/clients/redis-py/_index.md index 264dc0db7b..7f3b098216 100644 --- a/content/develop/clients/redis-py/_index.md +++ b/content/develop/clients/redis-py/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/python/redis-py categories: - docs - develop diff --git a/content/develop/clients/redis-vl.md b/content/develop/clients/redis-vl.md index 0e43545374..2097546d26 100644 --- a/content/develop/clients/redis-vl.md +++ b/content/develop/clients/redis-vl.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/clients/python/redis-vl categories: - docs - develop From 27993f25a0354e9dc229695232269c887a205576 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Fri, 8 Nov 2024 16:18:48 +0000 Subject: [PATCH 11/17] DOC-4543 fix links to client section pages --- content/commands/client-caching/index.md | 2 +- content/commands/client-trackinginfo/index.md | 2 +- content/develop/clients/_index.md | 14 +++++++------- content/develop/clients/jedis/_index.md | 2 +- content/develop/clients/jedis/connect.md | 4 ++-- content/develop/clients/lettuce/_index.md | 2 +- content/develop/clients/lettuce/connect.md | 2 +- content/develop/clients/pools-and-muxing.md | 10 +++++----- content/develop/clients/redis-py/connect.md | 4 ++-- content/develop/data-types/timeseries/clients.md | 6 +++--- content/develop/reference/client-side-caching.md | 2 +- content/integrate/NRedisStack/_index.md | 2 +- content/integrate/jedis/_index.md | 2 +- content/integrate/lettuce/_index.md | 2 +- content/integrate/node-redis/_index.md | 2 +- content/operate/rc/databases/connect.md | 6 +++--- content/operate/rc/rc-quickstart.md | 6 +++--- .../connect/supported-clients-browsers.md | 8 ++++---- .../rs/references/client_references/_index.md | 8 ++++---- 19 files changed, 43 insertions(+), 43 deletions(-) diff --git a/content/commands/client-caching/index.md b/content/commands/client-caching/index.md index 44b70c349f..f5c679e640 100644 --- a/content/commands/client-caching/index.md +++ b/content/commands/client-caching/index.md @@ -43,7 +43,7 @@ title: CLIENT CACHING This command controls the tracking of the keys in the next command executed by the connection, when tracking is enabled in `OPTIN` or `OPTOUT` mode. Please check the -[client side caching documentation]({{< relref "/develop/connect/clients/client-side-caching" >}}) for +[client side caching documentation]({{< relref "/develop/clients/client-side-caching" >}}) for background information. When tracking is enabled Redis, using the [`CLIENT TRACKING`]({{< relref "/commands/client-tracking" >}}) command, it is diff --git a/content/commands/client-trackinginfo/index.md b/content/commands/client-trackinginfo/index.md index cb194690f7..361fa74194 100644 --- a/content/commands/client-trackinginfo/index.md +++ b/content/commands/client-trackinginfo/index.md @@ -29,7 +29,7 @@ syntax_fmt: CLIENT TRACKINGINFO syntax_str: '' title: CLIENT TRACKINGINFO --- -The command returns information about the current client connection's use of the [server assisted client side caching]({{< relref "/develop/connect/clients/client-side-caching" >}}) feature. +The command returns information about the current client connection's use of the [server assisted client side caching]({{< relref "/develop/clients/client-side-caching" >}}) feature. Here's the list of tracking information sections and their respective values: diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index 3921971b94..3119f9a23c 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -23,14 +23,14 @@ for six main languages: | Language | Client name | Docs | Supported | | :-- | :-- | :-- | :-- | -| [Python](https://www.python.org/) | [`redis-py`](https://github.com/redis/redis-py) |[Redis Python library guide]({{< relref "/develop/connect/clients/python/redis-py" >}}) | Yes | +| [Python](https://www.python.org/) | [`redis-py`](https://github.com/redis/redis-py) |[Redis Python library guide]({{< relref "/develop/clients/redis-py" >}}) | Yes | | [Python](https://www.python.org/) | [`RedisVL`](https://github.com/redis/redis-vl-python) |[RedisVL guide]({{< relref "/integrate/redisvl" >}}) | Yes -| [C#/.NET](https://learn.microsoft.com/en-us/dotnet/csharp/) | [`NRedisStack`](https://github.com/redis/NRedisStack) |[C#/.NET guide]({{< relref "/develop/connect/clients/dotnet" >}}) | Yes | -| [Node.js](https://nodejs.org/en) | [`node-redis`](https://github.com/redis/node-redis) | [Node.js guide]({{< relref "/develop/connect/clients/nodejs" >}}) | Yes | -| [Java](https://www.java.com/en/) | [`Jedis`](https://github.com/redis/jedis) | [Jedis guide]({{< relref "/develop/connect/clients/java/jedis" >}}) | Yes | -| [Java](https://www.java.com/en/) | [`Lettuce`](https://github.com/redis/lettuce) | [Lettuce guide]({{< relref "/develop/connect/clients/java/lettuce" >}}) | Yes | -| [Go](https://go.dev/) | [`go-redis`](https://github.com/redis/go-redis) | [Go guide]({{< relref "/develop/connect/clients/go" >}}) | Yes | -| [PHP](https://www.php.net/)| [`Predis`](https://github.com/predis/predis) | [PHP guide]({{< relref "/develop/connect/clients/php" >}}) | No | +| [C#/.NET](https://learn.microsoft.com/en-us/dotnet/csharp/) | [`NRedisStack`](https://github.com/redis/NRedisStack) |[C#/.NET guide]({{< relref "/develop/clients/dotnet" >}}) | Yes | +| [Node.js](https://nodejs.org/en) | [`node-redis`](https://github.com/redis/node-redis) | [Node.js guide]({{< relref "/develop/clients/nodejs" >}}) | Yes | +| [Java](https://www.java.com/en/) | [`Jedis`](https://github.com/redis/jedis) | [Jedis guide]({{< relref "/develop/clients/jedis" >}}) | Yes | +| [Java](https://www.java.com/en/) | [`Lettuce`](https://github.com/redis/lettuce) | [Lettuce guide]({{< relref "/develop/clients/lettuce" >}}) | Yes | +| [Go](https://go.dev/) | [`go-redis`](https://github.com/redis/go-redis) | [Go guide]({{< relref "/develop/clients/go" >}}) | Yes | +| [PHP](https://www.php.net/)| [`Predis`](https://github.com/predis/predis) | [PHP guide]({{< relref "/develop/clients/php" >}}) | No | We also provide several higher-level [object mapping (OM)]({{< relref "/develop/connect/clients/om-clients" >}}) diff --git a/content/develop/clients/jedis/_index.md b/content/develop/clients/jedis/_index.md index b3fbc8a462..1ae36dca9d 100644 --- a/content/develop/clients/jedis/_index.md +++ b/content/develop/clients/jedis/_index.md @@ -17,7 +17,7 @@ weight: 5 --- [Jedis](https://github.com/redis/jedis) is a synchronous Java client for Redis. -Use [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}) if you need +Use [Lettuce]({{< relref "/develop/clients/lettuce" >}}) if you need a more advanced Java client that also supports asynchronous and reactive connections. The sections below explain how to install `Jedis` and connect your application to a Redis database. diff --git a/content/develop/clients/jedis/connect.md b/content/develop/clients/jedis/connect.md index 4f40296582..5eaba4c4f2 100644 --- a/content/develop/clients/jedis/connect.md +++ b/content/develop/clients/jedis/connect.md @@ -151,7 +151,7 @@ public class Main { Client-side caching is a technique to reduce network traffic between the client and server, resulting in better performance. See -[Client-side caching introduction]({{< relref "/develop/connect/clients/client-side-caching" >}}) +[Client-side caching introduction]({{< relref "/develop/clients/client-side-caching" >}}) for more information about how client-side caching works and how to use it effectively. To enable client-side caching, specify the @@ -274,7 +274,7 @@ one of its open connections. When you subsequently close the same connection, it is not actually closed but simply returned to the pool for reuse. This avoids the overhead of repeated connecting and disconnecting. See -[Connection pools and multiplexing]({{< relref "/develop/connect/clients/pools-and-muxing" >}}) +[Connection pools and multiplexing]({{< relref "/develop/clients/pools-and-muxing" >}}) for more information. Use the following code to connect with a connection pool: diff --git a/content/develop/clients/lettuce/_index.md b/content/develop/clients/lettuce/_index.md index 0b6b85c063..8c8c9b9c6f 100644 --- a/content/develop/clients/lettuce/_index.md +++ b/content/develop/clients/lettuce/_index.md @@ -19,7 +19,7 @@ weight: 6 [Lettuce](https://github.com/redis/lettuce/tree/main/src/main) is an advanced Java client for Redis that supports synchronous, asynchronous, and reactive connections. If you only need synchronous connections then you may find the other Java client -[Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) easier to use. +[Jedis]({{< relref "/develop/clients/jedis" >}}) easier to use. The sections below explain how to install `Lettuce` and connect your application to a Redis database. diff --git a/content/develop/clients/lettuce/connect.md b/content/develop/clients/lettuce/connect.md index ad04d1d9dc..c44830ec40 100644 --- a/content/develop/clients/lettuce/connect.md +++ b/content/develop/clients/lettuce/connect.md @@ -176,7 +176,7 @@ For connection pooling, Lettuce leverages `RedisClient` or `RedisClusterClient`, A typical approach with Lettuce is to create a single `RedisClient` instance and reuse it to establish connections to your Redis server(s). These connections are multiplexed; that is, multiple commands can be run concurrently over a single or a small set of connections, making explicit pooling less practical. See -[Connection pools and multiplexing]({{< relref "/develop/connect/clients/pools-and-muxing" >}}) +[Connection pools and multiplexing]({{< relref "/develop/clients/pools-and-muxing" >}}) for more information. Lettuce provides pool config to be used with Lettuce asynchronous connection methods. diff --git a/content/develop/clients/pools-and-muxing.md b/content/develop/clients/pools-and-muxing.md index 11d91b7ca3..ad4decce0b 100644 --- a/content/develop/clients/pools-and-muxing.md +++ b/content/develop/clients/pools-and-muxing.md @@ -27,13 +27,13 @@ code by making as few separate connections as possible. Managing connections in your own code can be tricky, so the Redis client libraries give you some help. The two basic approaches to connection management are called *connection pooling* and *multiplexing*. -The [`redis-py`]({{< relref "/develop/connect/clients/python/redis-py" >}}), -[`jedis`]({{< relref "/develop/connect/clients/java/jedis" >}}), and -[`go-redis`]({{< relref "/develop/connect/clients/go" >}}) clients support +The [`redis-py`]({{< relref "/develop/clients/redis-py" >}}), +[`jedis`]({{< relref "/develop/clients/jedis" >}}), and +[`go-redis`]({{< relref "/develop/clients/go" >}}) clients support connection pooling, while -[`NRedisStack`]({{< relref "/develop/connect/clients/dotnet" >}}) +[`NRedisStack`]({{< relref "/develop/clients/dotnet" >}}) supports multiplexing. -[`Lettuce`]({{< relref "/develop/connect/clients/java/lettuce" >}}) +[`Lettuce`]({{< relref "/develop/clients/lettuce" >}}) supports both approaches. ## Connection pooling diff --git a/content/develop/clients/redis-py/connect.md b/content/develop/clients/redis-py/connect.md index f0b2f66579..c179c825be 100644 --- a/content/develop/clients/redis-py/connect.md +++ b/content/develop/clients/redis-py/connect.md @@ -95,7 +95,7 @@ For more information, see [redis-py TLS examples](https://redis-py.readthedocs.i Client-side caching is a technique to reduce network traffic between the client and server, resulting in better performance. See -[Client-side caching introduction]({{< relref "/develop/connect/clients/client-side-caching" >}}) +[Client-side caching introduction]({{< relref "/develop/clients/client-side-caching" >}}) for more information about how client-side caching works and how to use it effectively. To enable client-side caching, add some extra parameters when you connect @@ -214,7 +214,7 @@ one of its open connections. When you subsequently close the same connection, it is not actually closed but simply returned to the pool for reuse. This avoids the overhead of repeated connecting and disconnecting. See -[Connection pools and multiplexing]({{< relref "/develop/connect/clients/pools-and-muxing" >}}) +[Connection pools and multiplexing]({{< relref "/develop/clients/pools-and-muxing" >}}) for more information. Use the following code to connect with a connection pool: diff --git a/content/develop/data-types/timeseries/clients.md b/content/develop/data-types/timeseries/clients.md index f49401a826..de2270860a 100644 --- a/content/develop/data-types/timeseries/clients.md +++ b/content/develop/data-types/timeseries/clients.md @@ -22,7 +22,7 @@ The table below shows the client libraries that support Redis time series: | Language | Client | | :-- | :-- | | Python | [redis-py]({{< relref "/develop/connect/clients/python" >}}) | -| JavaScript | [node-redis]({{< relref "/develop/connect/clients/nodejs" >}}) | -| Java | [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) | -| C#/.NET | [NRedisStack]({{< relref "/develop/connect/clients/dotnet" >}}) | +| JavaScript | [node-redis]({{< relref "/develop/clients/nodejs" >}}) | +| Java | [Jedis]({{< relref "/develop/clients/jedis" >}}) | +| C#/.NET | [NRedisStack]({{< relref "/develop/clients/dotnet" >}}) | | Go | [redistimeseries-go](https://github.com/RedisTimeSeries/redistimeseries-go/) diff --git a/content/develop/reference/client-side-caching.md b/content/develop/reference/client-side-caching.md index c8fe2dd0a9..266226cad8 100644 --- a/content/develop/reference/client-side-caching.md +++ b/content/develop/reference/client-side-caching.md @@ -20,7 +20,7 @@ weight: 2 {{}}This document is intended as an in-depth reference for client-side caching. See -[Client-side caching introduction]({{< relref "/develop/connect/clients/client-side-caching" >}}) +[Client-side caching introduction]({{< relref "/develop/clients/client-side-caching" >}}) for general usage guidelines. {{}} diff --git a/content/integrate/NRedisStack/_index.md b/content/integrate/NRedisStack/_index.md index 37723aaca4..22825ead70 100644 --- a/content/integrate/NRedisStack/_index.md +++ b/content/integrate/NRedisStack/_index.md @@ -18,4 +18,4 @@ weight: 2 Connect your C#/.NET application to a Redis database using the NRedisStack client library. -Refer to the complete [C#/.NET guide]({{< relref "/develop/connect/clients/dotnet" >}}) to install, connect, and use NRedisStack. +Refer to the complete [C#/.NET guide]({{< relref "/develop/clients/dotnet" >}}) to install, connect, and use NRedisStack. diff --git a/content/integrate/jedis/_index.md b/content/integrate/jedis/_index.md index f31a89cb96..a8cf59387b 100644 --- a/content/integrate/jedis/_index.md +++ b/content/integrate/jedis/_index.md @@ -18,4 +18,4 @@ weight: 2 Connect your Java application to a Redis database using the Jedis client library. -Refer to the complete [Jedis guide]({{< relref "/develop/connect/clients/java/jedis" >}}) to install, connect, and use Jedis. +Refer to the complete [Jedis guide]({{< relref "/develop/clients/jedis" >}}) to install, connect, and use Jedis. diff --git a/content/integrate/lettuce/_index.md b/content/integrate/lettuce/_index.md index 87a68c30a7..30657dd99d 100644 --- a/content/integrate/lettuce/_index.md +++ b/content/integrate/lettuce/_index.md @@ -18,4 +18,4 @@ weight: 2 Connect your Java application to a Redis database using the Lettuce client library. -Refer to the complete [Lettuce guide]({{< relref "/develop/connect/clients/java/lettuce" >}}) to install, connect, and use Lettuce. +Refer to the complete [Lettuce guide]({{< relref "/develop/clients/lettuce" >}}) to install, connect, and use Lettuce. diff --git a/content/integrate/node-redis/_index.md b/content/integrate/node-redis/_index.md index 72080263f6..54ddbde38e 100644 --- a/content/integrate/node-redis/_index.md +++ b/content/integrate/node-redis/_index.md @@ -18,4 +18,4 @@ weight: 2 Connect your Node.js application to a Redis database using the node-redis client library. -Refer to the complete [Node.js guide]({{< relref "/develop/connect/clients/nodejs" >}}) to install, connect, and use node-redis. +Refer to the complete [Node.js guide]({{< relref "/develop/clients/nodejs" >}}) to install, connect, and use node-redis. diff --git a/content/operate/rc/databases/connect.md b/content/operate/rc/databases/connect.md index 598c863d3e..9c4a7a2c7c 100644 --- a/content/operate/rc/databases/connect.md +++ b/content/operate/rc/databases/connect.md @@ -55,10 +55,10 @@ A Redis client is a software library or tool that enables applications to intera The connection wizard provides code snippets to connect to your database with the following programming languages: -- node.js using [node-redis]({{< relref "/develop/connect/clients/nodejs" >}}) +- node.js using [node-redis]({{< relref "/develop/clients/nodejs" >}}) - .NET using [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) -- Python using [redis-py]({{< relref "/develop/connect/clients/python/redis-py" >}}) -- Java using [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) +- Python using [redis-py]({{< relref "/develop/clients/redis-py" >}}) +- Java using [Jedis]({{< relref "/develop/clients/jedis" >}}) {{The connection wizard clients.}} diff --git a/content/operate/rc/rc-quickstart.md b/content/operate/rc/rc-quickstart.md index 0d19e680b0..503a3dbdcd 100644 --- a/content/operate/rc/rc-quickstart.md +++ b/content/operate/rc/rc-quickstart.md @@ -115,10 +115,10 @@ A Redis client is a software library or tool that enables applications to intera The connection wizard provides code snippets to connect to your database with the following programming languages: -- node.js using [node-redis]({{< relref "/develop/connect/clients/nodejs" >}}) +- node.js using [node-redis]({{< relref "/develop/clients/nodejs" >}}) - .NET using [StackExchange.Redis](https://stackexchange.github.io/StackExchange.Redis/) -- Python using [redis-py]({{< relref "/develop/connect/clients/python/redis-py" >}}) -- Java using [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) +- Python using [redis-py]({{< relref "/develop/clients/redis-py" >}}) +- Java using [Jedis]({{< relref "/develop/clients/jedis" >}}) {{The connection wizard clients.}} diff --git a/content/operate/rs/databases/connect/supported-clients-browsers.md b/content/operate/rs/databases/connect/supported-clients-browsers.md index 0520656927..e3678d6b5a 100644 --- a/content/operate/rs/databases/connect/supported-clients-browsers.md +++ b/content/operate/rs/databases/connect/supported-clients-browsers.md @@ -29,10 +29,10 @@ Note: You cannot use client libraries to configure Redis Enterprise Software. I We recommend the following clients when using a [discovery service]({{< relref "/operate/rs/databases/durability-ha/discovery-service.md" >}}) based on the Redis Sentinel API: - [redis-py]({{< relref "/develop/connect/clients/python" >}}) (Python client) -- [NRedisStack]({{< relref "/develop/connect/clients/dotnet" >}}) (.NET client) -- [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) (synchronous Java client) -- [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}) (asynchronous Java client) -- [go-redis]({{< relref "/develop/connect/clients/go" >}}) (Go client) +- [NRedisStack]({{< relref "/develop/clients/dotnet" >}}) (.NET client) +- [Jedis]({{< relref "/develop/clients/jedis" >}}) (synchronous Java client) +- [Lettuce]({{< relref "/develop/clients/lettuce" >}}) (asynchronous Java client) +- [go-redis]({{< relref "/develop/clients/go" >}}) (Go client) - [Hiredis](https://github.com/redis/hiredis) (C client) If you need to use another client, you can use [Sentinel Tunnel](https://github.com/RedisLabs/sentinel_tunnel) diff --git a/content/operate/rs/references/client_references/_index.md b/content/operate/rs/references/client_references/_index.md index 5644bab515..b49638869d 100644 --- a/content/operate/rs/references/client_references/_index.md +++ b/content/operate/rs/references/client_references/_index.md @@ -18,10 +18,10 @@ To connect to Redis instances from within your application, use a Redis client l | Language | Client name | | :---------- | :------------- | -| .Net | [NRedisStack]({{< relref "/develop/connect/clients/dotnet" >}}) | -| Go | [go-redis]({{< relref "/develop/connect/clients/go" >}}) | -| Java | [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) (Synchronous) and [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}) (Asynchronous) | -| Node.js | [node-redis]({{< relref "/develop/connect/clients/nodejs" >}}) | +| .Net | [NRedisStack]({{< relref "/develop/clients/dotnet" >}}) | +| Go | [go-redis]({{< relref "/develop/clients/go" >}}) | +| Java | [Jedis]({{< relref "/develop/clients/jedis" >}}) (Synchronous) and [Lettuce]({{< relref "/develop/clients/lettuce" >}}) (Asynchronous) | +| Node.js | [node-redis]({{< relref "/develop/clients/nodejs" >}}) | | Python | [redis-py]({{< relref "/develop/connect/clients/python" >}}) | Select a client name to see its quick start. From 979a00371eb2aff887152ffccf24967e1e258979 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Fri, 8 Nov 2024 16:21:13 +0000 Subject: [PATCH 12/17] DOC-4543 fixed links to CLI page --- content/develop/clients/_index.md | 2 +- content/develop/clients/redis-py/connect.md | 2 +- .../data-types/probabilistic/Configuration.md | 2 +- .../develop/data-types/timeseries/configuration.md | 2 +- .../develop/interact/programmability/eval-intro.md | 2 +- .../search-and-query/advanced-concepts/tags.md | 2 +- .../basic-constructs/configuration-parameters.md | 2 +- content/develop/reference/eviction/index.md | 2 +- content/develop/reference/protocol-spec.md | 2 +- content/develop/tools/_index.md | 2 +- content/develop/tools/redis-for-vscode/_index.md | 4 ++-- content/integrate/amazon-bedrock/set-up-redis.md | 2 +- .../install/install-redis/install-redis-on-linux.md | 2 +- .../install/install-redis/install-redis-on-mac-os.md | 2 +- .../install-redis/install-redis-on-windows.md | 2 +- .../oss_and_stack/install/install-stack/linux.md | 2 +- .../oss_and_stack/install/install-stack/mac-os.md | 2 +- content/operate/rc/databases/connect.md | 4 ++-- content/operate/rc/rc-quickstart.md | 4 ++-- content/operate/rs/clusters/_index.md | 2 +- content/operate/rs/clusters/configure/_index.md | 2 +- content/operate/rs/databases/_index.md | 2 +- content/operate/rs/databases/configure/_index.md | 2 +- .../rs/references/cli-utilities/redis-cli/_index.md | 12 ++++++------ 24 files changed, 32 insertions(+), 32 deletions(-) diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index 3119f9a23c..523789fae1 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -58,5 +58,5 @@ You will need access to a Redis server to use these libraries. You can experiment with a local installation of Redis Stack (see [Install Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}})) or with a free trial of [Redis Cloud]({{< relref "/operate/rc" >}}). To interact with a Redis server without writing code, use the -[Redis CLI]({{< relref "/develop/connect/cli" >}}) and +[Redis CLI]({{< relref "/develop/tools/cli" >}}) and [Redis Insight]({{< relref "/develop/connect/insight" >}}) tools. diff --git a/content/develop/clients/redis-py/connect.md b/content/develop/clients/redis-py/connect.md index c179c825be..b06e3e0399 100644 --- a/content/develop/clients/redis-py/connect.md +++ b/content/develop/clients/redis-py/connect.md @@ -132,7 +132,7 @@ cityNameAttempt2 = r.get("city") # Retrieved from cache ``` You can see the cache working if you connect to the same Redis database -with [`redis-cli`]({{< relref "/develop/connect/cli" >}}) and run the +with [`redis-cli`]({{< relref "/develop/tools/cli" >}}) and run the [`MONITOR`]({{< relref "/commands/monitor" >}}) command. If you run the code above with the `cache_config` line commented out, you should see the following in the CLI among the output from `MONITOR`: diff --git a/content/develop/data-types/probabilistic/Configuration.md b/content/develop/data-types/probabilistic/Configuration.md index 2500c0ee7c..0cc9071f90 100644 --- a/content/develop/data-types/probabilistic/Configuration.md +++ b/content/develop/data-types/probabilistic/Configuration.md @@ -28,7 +28,7 @@ In [redis.conf]({{< relref "/operate/oss_and_stack/management/config" >}}): loadmodule ./redisbloom.so [OPT VAL]... ``` -From the [Redis CLI]({{< relref "/develop/connect/cli" >}}), using the [MODULE LOAD]({{< relref "/commands/module-load" >}}) command: +From the [Redis CLI]({{< relref "/develop/tools/cli" >}}), using the [MODULE LOAD]({{< relref "/commands/module-load" >}}) command: ``` 127.0.0.6379> MODULE LOAD redisbloom.so [OPT VAL]... diff --git a/content/develop/data-types/timeseries/configuration.md b/content/develop/data-types/timeseries/configuration.md index 8e6670794a..2ae0b96963 100644 --- a/content/develop/data-types/timeseries/configuration.md +++ b/content/develop/data-types/timeseries/configuration.md @@ -28,7 +28,7 @@ In [redis.conf]({{< relref "/operate/oss_and_stack/management/config" >}}): loadmodule ./redistimeseries.so [OPT VAL]... ``` -From the [Redis CLI]({{< relref "/develop/connect/cli" >}}), using the [MODULE LOAD]({{< relref "/commands/module-load" >}}) command: +From the [Redis CLI]({{< relref "/develop/tools/cli" >}}), using the [MODULE LOAD]({{< relref "/commands/module-load" >}}) command: ``` 127.0.0.6379> MODULE LOAD redistimeseries.so [OPT VAL]... diff --git a/content/develop/interact/programmability/eval-intro.md b/content/develop/interact/programmability/eval-intro.md index 319d55154c..331cbafcc3 100644 --- a/content/develop/interact/programmability/eval-intro.md +++ b/content/develop/interact/programmability/eval-intro.md @@ -407,7 +407,7 @@ Note: an important part of this behavior is that the PRNG that Redis implements ## Debugging Eval scripts Starting with Redis 3.2, Redis has support for native Lua debugging. -The Redis Lua debugger is a remote debugger consisting of a server, which is Redis itself, and a client, which is by default [`redis-cli`]({{< relref "/develop/connect/cli" >}}). +The Redis Lua debugger is a remote debugger consisting of a server, which is Redis itself, and a client, which is by default [`redis-cli`]({{< relref "/develop/tools/cli" >}}). The Lua debugger is described in the [Lua scripts debugging]({{< relref "/develop/interact/programmability/lua-debugging" >}}) section of the Redis documentation. diff --git a/content/develop/interact/search-and-query/advanced-concepts/tags.md b/content/develop/interact/search-and-query/advanced-concepts/tags.md index c46a43b4dc..08da7f11cc 100644 --- a/content/develop/interact/search-and-query/advanced-concepts/tags.md +++ b/content/develop/interact/search-and-query/advanced-concepts/tags.md @@ -149,7 +149,7 @@ HSET test:1 tags "Andrew's Top 5,Justin's Top 5" However, when you query for those tags, you must escape the punctuation characters with a backslash (`\`). So, querying for the tag `Andrew's Top 5` in -[`redis-cli`]({{< relref "/develop/connect/cli" >}}) looks like this: +[`redis-cli`]({{< relref "/develop/tools/cli" >}}) looks like this: ``` FT.SEARCH punctuation "@tags:{ Andrew\\'s Top 5 }" diff --git a/content/develop/interact/search-and-query/basic-constructs/configuration-parameters.md b/content/develop/interact/search-and-query/basic-constructs/configuration-parameters.md index 08b2b5a094..a758ca5a27 100644 --- a/content/develop/interact/search-and-query/basic-constructs/configuration-parameters.md +++ b/content/develop/interact/search-and-query/basic-constructs/configuration-parameters.md @@ -29,7 +29,7 @@ In [redis.conf]({{< relref "/operate/oss_and_stack/management/config" >}}): loadmodule ./redisearch.so [OPT VAL]... ``` -From the [Redis CLI]({{< relref "/develop/connect/cli" >}}), using the [MODULE LOAD]({{< relref "/commands/module-load" >}}) command: +From the [Redis CLI]({{< relref "/develop/tools/cli" >}}), using the [MODULE LOAD]({{< relref "/commands/module-load" >}}) command: ``` 127.0.0.6379> MODULE LOAD redisearch.so [OPT VAL]... diff --git a/content/develop/reference/eviction/index.md b/content/develop/reference/eviction/index.md index 3953e2c586..e10580bde6 100644 --- a/content/develop/reference/eviction/index.md +++ b/content/develop/reference/eviction/index.md @@ -47,7 +47,7 @@ maxmemory 100mb ``` You can also use [`CONFIG SET`]({{< relref "/commands/config-set" >}}) to -set `maxmemory` at runtime using [`redis-cli`]({{< relref "/develop/connect/cli" >}}): +set `maxmemory` at runtime using [`redis-cli`]({{< relref "/develop/tools/cli" >}}): ```bash > CONFIG SET maxmemory 100mb diff --git a/content/develop/reference/protocol-spec.md b/content/develop/reference/protocol-spec.md index 3b68eac509..c800d2b75e 100644 --- a/content/develop/reference/protocol-spec.md +++ b/content/develop/reference/protocol-spec.md @@ -482,7 +482,7 @@ Example: (The raw RESP encoding is split into multiple lines for readability). Some client libraries may ignore the difference between this type and the string type and return a native string in both cases. -However, interactive clients, such as command line interfaces (e.g., [`redis-cli`]({{< relref "/develop/connect/cli" >}})), can use this type and know that their output should be presented to the human user as is and without quoting the string. +However, interactive clients, such as command line interfaces (e.g., [`redis-cli`]({{< relref "/develop/tools/cli" >}})), can use this type and know that their output should be presented to the human user as is and without quoting the string. For example, the Redis command [`INFO`]({{< relref "/commands/info" >}}) outputs a report that includes newlines. When using RESP3, `redis-cli` displays it correctly because it is sent as a Verbatim String reply (with its three bytes being "txt"). diff --git a/content/develop/tools/_index.md b/content/develop/tools/_index.md index 6741ac1fa8..c95f147a4b 100644 --- a/content/develop/tools/_index.md +++ b/content/develop/tools/_index.md @@ -25,7 +25,7 @@ manage it and interact with the data: ## Redis command line interface (CLI) -The [Redis command line interface]({{< relref "/develop/connect/cli" >}}) (also known as `redis-cli`) is a terminal program that sends commands to and reads replies from the Redis server. It has the following two main modes: +The [Redis command line interface]({{< relref "/develop/tools/cli" >}}) (also known as `redis-cli`) is a terminal program that sends commands to and reads replies from the Redis server. It has the following two main modes: 1. An interactive Read Eval Print Loop (REPL) mode where the user types Redis commands and receives replies. 2. A command mode where `redis-cli` is executed with additional arguments, and the reply is printed to the standard output. diff --git a/content/develop/tools/redis-for-vscode/_index.md b/content/develop/tools/redis-for-vscode/_index.md index 86a027fc7d..c221a060e6 100644 --- a/content/develop/tools/redis-for-vscode/_index.md +++ b/content/develop/tools/redis-for-vscode/_index.md @@ -48,7 +48,7 @@ Click on the Redis mark (the cursive **R**) in the VS Code menu to begin connect {{< image filename="images/dev/connect/vscode/vscode-initial.png" >}} -Click on the **+ Connect database** button. A dialog will display in the main pane. In the image shown below, all the options have been checked to show the available details for each connection. These connection details are similar to those accessible from [`redis-cli`]({{< relref "/develop/connect/cli" >}}). +Click on the **+ Connect database** button. A dialog will display in the main pane. In the image shown below, all the options have been checked to show the available details for each connection. These connection details are similar to those accessible from [`redis-cli`]({{< relref "/develop/tools/cli" >}}). {{< note >}} In the first release of Redis for VS Code, there is no way to change the logical database after you have selected it. If you need to connect to a different logical database, you need to add a separate database connection. @@ -143,4 +143,4 @@ The connection tool with the boxed `>_` icon opens a Redis CLI window in the **R {{< image filename="images/dev/connect/vscode/vscode-cli.png" >}} -The CLI interface works just like the [`redis-cli`]({{< relref "/develop/connect/cli" >}}) command. +The CLI interface works just like the [`redis-cli`]({{< relref "/develop/tools/cli" >}}) command. diff --git a/content/integrate/amazon-bedrock/set-up-redis.md b/content/integrate/amazon-bedrock/set-up-redis.md index dc10015030..b0ade9d8c6 100644 --- a/content/integrate/amazon-bedrock/set-up-redis.md +++ b/content/integrate/amazon-bedrock/set-up-redis.md @@ -250,7 +250,7 @@ To create your vector index in Redis Insight: ### `redis-cli` -The [`redis-cli`]({{< relref "/develop/connect/cli" >}}) command-line utility lets you connect and run Redis commands directly from the command line. To use `redis-cli`, you can [install Redis]({{< relref "/operate/oss_and_stack/stack-with-enterprise/install/" >}}). +The [`redis-cli`]({{< relref "/develop/tools/cli" >}}) command-line utility lets you connect and run Redis commands directly from the command line. To use `redis-cli`, you can [install Redis]({{< relref "/operate/oss_and_stack/stack-with-enterprise/install/" >}}). Public endpoint and port details are available from the **Databases** list or the database's **Configuration** screen. Select **Connect** to view how to connect to your database with `redis-cli`. diff --git a/content/operate/oss_and_stack/install/install-redis/install-redis-on-linux.md b/content/operate/oss_and_stack/install/install-redis/install-redis-on-linux.md index b9865709bb..c252ae0ad3 100644 --- a/content/operate/oss_and_stack/install/install-redis/install-redis-on-linux.md +++ b/content/operate/oss_and_stack/install/install-redis/install-redis-on-linux.md @@ -103,7 +103,7 @@ You can also test that your Redis server is running using Once you have a running Redis instance, you may want to: -* Try the [Redis CLI tutorial]({{< relref "/develop/connect/cli" >}}) +* Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) * Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. diff --git a/content/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os.md b/content/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os.md index def9ff0607..604a6fee71 100644 --- a/content/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os.md +++ b/content/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os.md @@ -96,7 +96,7 @@ You can also test that your Redis server is running using Once you have a running Redis instance, you may want to: -* Try the [Redis CLI tutorial]({{< relref "/develop/connect/cli" >}}) +* Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) * Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. diff --git a/content/operate/oss_and_stack/install/install-redis/install-redis-on-windows.md b/content/operate/oss_and_stack/install/install-redis/install-redis-on-windows.md index b2c4c2c0f9..054c572d4a 100644 --- a/content/operate/oss_and_stack/install/install-redis/install-redis-on-windows.md +++ b/content/operate/oss_and_stack/install/install-redis/install-redis-on-windows.md @@ -60,7 +60,7 @@ You can also test that your Redis server is running using Once you have a running Redis instance, you may want to: -* Try the [Redis CLI tutorial]({{< relref "/develop/connect/cli" >}}) +* Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) * Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. diff --git a/content/operate/oss_and_stack/install/install-stack/linux.md b/content/operate/oss_and_stack/install/install-stack/linux.md index 5afcaaee97..e87e74a9bd 100644 --- a/content/operate/oss_and_stack/install/install-stack/linux.md +++ b/content/operate/oss_and_stack/install/install-stack/linux.md @@ -197,7 +197,7 @@ You can also test that your Redis server is running using Once you have a running Redis instance, you may want to: -* Try the [Redis CLI tutorial]({{< relref "/develop/connect/cli" >}}) +* Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) * Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. diff --git a/content/operate/oss_and_stack/install/install-stack/mac-os.md b/content/operate/oss_and_stack/install/install-stack/mac-os.md index bddd4c187f..7f464ba4fd 100644 --- a/content/operate/oss_and_stack/install/install-stack/mac-os.md +++ b/content/operate/oss_and_stack/install/install-stack/mac-os.md @@ -140,7 +140,7 @@ You can also test that your Redis server is running using Once you have a running Redis instance, you may want to: -* Try the [Redis CLI tutorial]({{< relref "/develop/connect/cli" >}}) +* Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) * Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. diff --git a/content/operate/rc/databases/connect.md b/content/operate/rc/databases/connect.md index 9c4a7a2c7c..11da92254f 100644 --- a/content/operate/rc/databases/connect.md +++ b/content/operate/rc/databases/connect.md @@ -68,11 +68,11 @@ See [Clients]({{< relref "/develop/connect/clients/" >}}) to learn how to connec ### redis-cli {#using-rediscli} -The [`redis-cli`]({{< relref "/develop/connect/cli" >}}) utility is installed when you install Redis. It provides a command-line interface that lets you work with your database using core [Redis commands]({{< relref "/commands" >}}). +The [`redis-cli`]({{< relref "/develop/tools/cli" >}}) utility is installed when you install Redis. It provides a command-line interface that lets you work with your database using core [Redis commands]({{< relref "/commands" >}}). To run `redis-cli`, [install Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) on your machine. After it's installed, copy the `redis-cli` command under **Redis CLI** in the connection wizard and enter it into your terminal. If the username and password are not already filled in, replace `` and `` with your username and password. -See [Redis CLI]({{< relref "/develop/connect/cli" >}}) to learn how to use `redis-cli`. +See [Redis CLI]({{< relref "/develop/tools/cli" >}}) to learn how to use `redis-cli`. ## More info diff --git a/content/operate/rc/rc-quickstart.md b/content/operate/rc/rc-quickstart.md index 503a3dbdcd..fd3a22dd88 100644 --- a/content/operate/rc/rc-quickstart.md +++ b/content/operate/rc/rc-quickstart.md @@ -126,11 +126,11 @@ See [Clients]({{< relref "/develop/connect/clients/" >}}) to learn how to connec ### redis-cli {#using-rediscli} -The [`redis-cli`]({{< relref "/develop/connect/cli" >}}) utility is installed when you install Redis. It provides a command-line interface that lets you work with your database using core [Redis commands]({{< relref "/commands" >}}). +The [`redis-cli`]({{< relref "/develop/tools/cli" >}}) utility is installed when you install Redis. It provides a command-line interface that lets you work with your database using core [Redis commands]({{< relref "/commands" >}}). To run `redis-cli`, [install Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) on your machine. -See [Redis CLI]({{< relref "/develop/connect/cli" >}}) to learn how to use `redis-cli`. +See [Redis CLI]({{< relref "/develop/tools/cli" >}}) to learn how to use `redis-cli`. ## More info diff --git a/content/operate/rs/clusters/_index.md b/content/operate/rs/clusters/_index.md index 15f80a9d0d..c9415310bd 100644 --- a/content/operate/rs/clusters/_index.md +++ b/content/operate/rs/clusters/_index.md @@ -15,5 +15,5 @@ weight: 36 You can manage your Redis Enterprise Software clusters with several different tools: - Cluster Manager UI (the web-based user interface) -- Command-line tools ([rladmin]({{< relref "/operate/rs/references/cli-utilities/rladmin" >}}), [redis-cli]({{< relref "/develop/connect/cli" >}}), [crdb-cli]({{< relref "/operate/rs/references/cli-utilities/crdb-cli" >}})) +- Command-line tools ([rladmin]({{< relref "/operate/rs/references/cli-utilities/rladmin" >}}), [redis-cli]({{< relref "/develop/tools/cli" >}}), [crdb-cli]({{< relref "/operate/rs/references/cli-utilities/crdb-cli" >}})) - [REST API]({{< relref "/operate/rs/references/rest-api/_index.md" >}}) diff --git a/content/operate/rs/clusters/configure/_index.md b/content/operate/rs/clusters/configure/_index.md index 01278ad023..5747f442b2 100644 --- a/content/operate/rs/clusters/configure/_index.md +++ b/content/operate/rs/clusters/configure/_index.md @@ -13,7 +13,7 @@ weight: 50 You can manage your Redis Enterprise Software clusters with several different tools: - Cluster Manager UI (the web-based user interface) -- Command-line tools ([rladmin]({{< relref "/operate/rs/references/cli-utilities/rladmin" >}}), [redis-cli]({{< relref "/develop/connect/cli" >}}), [crdb-cli]({{< relref "/operate/rs/references/cli-utilities/crdb-cli" >}})) +- Command-line tools ([rladmin]({{< relref "/operate/rs/references/cli-utilities/rladmin" >}}), [redis-cli]({{< relref "/develop/tools/cli" >}}), [crdb-cli]({{< relref "/operate/rs/references/cli-utilities/crdb-cli" >}})) - [REST API]({{< relref "/operate/rs/references/rest-api/_index.md" >}}) diff --git a/content/operate/rs/databases/_index.md b/content/operate/rs/databases/_index.md index d76785dd86..a5366a808e 100644 --- a/content/operate/rs/databases/_index.md +++ b/content/operate/rs/databases/_index.md @@ -15,7 +15,7 @@ weight: 37 You can manage your Redis Enterprise Software databases with several different tools: - Cluster Manager UI (the web-based user interface) -- Command-line tools ([`rladmin`]({{< relref "/operate/rs/references/cli-utilities/rladmin" >}}), [`redis-cli`]({{< relref "/develop/connect/cli" >}}), [`crdb-cli`]({{< relref "/operate/rs/references/cli-utilities/crdb-cli" >}})) +- Command-line tools ([`rladmin`]({{< relref "/operate/rs/references/cli-utilities/rladmin" >}}), [`redis-cli`]({{< relref "/develop/tools/cli" >}}), [`crdb-cli`]({{< relref "/operate/rs/references/cli-utilities/crdb-cli" >}})) - [REST API]({{< relref "/operate/rs/references/rest-api/_index.md" >}}) diff --git a/content/operate/rs/databases/configure/_index.md b/content/operate/rs/databases/configure/_index.md index 9dd066054b..49352b4205 100644 --- a/content/operate/rs/databases/configure/_index.md +++ b/content/operate/rs/databases/configure/_index.md @@ -22,7 +22,7 @@ You can manage your Redis Enterprise Software databases with several tools: - [`crdb-cli`]({{< relref "/operate/rs/references/cli-utilities/crdb-cli" >}}) for Active-Active database configuration - - [`redis-cli`]({{< relref "/develop/connect/cli" >}}) for Redis Community Edition configuration + - [`redis-cli`]({{< relref "/develop/tools/cli" >}}) for Redis Community Edition configuration - [REST API]({{< relref "/operate/rs/references/rest-api/_index.md" >}}) diff --git a/content/operate/rs/references/cli-utilities/redis-cli/_index.md b/content/operate/rs/references/cli-utilities/redis-cli/_index.md index a222c1e75b..145ea587e7 100644 --- a/content/operate/rs/references/cli-utilities/redis-cli/_index.md +++ b/content/operate/rs/references/cli-utilities/redis-cli/_index.md @@ -102,15 +102,15 @@ $ redis-cli -h -p 12000 GET mykey "Hello world" ``` -For more information, see [Command line usage]({{< relref "/develop/connect/cli" >}}#command-line-usage). +For more information, see [Command line usage]({{< relref "/develop/tools/cli" >}}#command-line-usage). ## Interactive mode -In `redis-cli` [interactive mode]({{< relref "/develop/connect/cli" >}}#interactive-mode), you can: +In `redis-cli` [interactive mode]({{< relref "/develop/tools/cli" >}}#interactive-mode), you can: - Run any `redis-cli` command without prefacing it with `redis-cli`. -- Enter `?` for more information about how to use the `HELP` command and [set `redis-cli` preferences]({{< relref "/develop/connect/cli" >}}#preferences). -- Enter [`HELP`]({{< relref "/develop/connect/cli" >}}#showing-help-about-redis-commands) followed by the name of a command for more information about the command and its options. +- Enter `?` for more information about how to use the `HELP` command and [set `redis-cli` preferences]({{< relref "/develop/tools/cli" >}}#preferences). +- Enter [`HELP`]({{< relref "/develop/tools/cli" >}}#showing-help-about-redis-commands) followed by the name of a command for more information about the command and its options. - Press the `Tab` key for command completion. - Enter `exit` or `quit` or press `Control+D` to exit interactive mode and return to the terminal prompt. @@ -144,9 +144,9 @@ Scan the database for big keys: redis-cli -h -p --bigkeys ``` -See [Scanning for big keys]({{< relref "/develop/connect/cli" >}}#scanning-for-big-keys) for more information. +See [Scanning for big keys]({{< relref "/develop/tools/cli" >}}#scanning-for-big-keys) for more information. ## More info -- [Redis CLI documentation]({{< relref "/develop/connect/cli" >}}) +- [Redis CLI documentation]({{< relref "/develop/tools/cli" >}}) - [Redis commands reference]({{< relref "/commands/" >}} From 96063b620c7749d527ede58c9e7bf3d0f68d30fe Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Mon, 11 Nov 2024 10:27:24 +0000 Subject: [PATCH 13/17] DOC-4543 fixed more broken links --- content/develop/clients/dotnet/connect.md | 2 +- content/develop/clients/jedis/connect.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/develop/clients/dotnet/connect.md b/content/develop/clients/dotnet/connect.md index c1d8ab07c0..b9ad530060 100644 --- a/content/develop/clients/dotnet/connect.md +++ b/content/develop/clients/dotnet/connect.md @@ -144,5 +144,5 @@ connections efficiently. NRedisStack uses a different approach called single connection. NRedisStack manages multiplexing for you automatically. This gives high performance without requiring any extra coding. See -[Connection pools and multiplexing]({{< relref "/develop/connect/clients/pools-and-muxing" >}}) +[Connection pools and multiplexing]({{< relref "/develop/clients/pools-and-muxing" >}}) for more information. diff --git a/content/develop/clients/jedis/connect.md b/content/develop/clients/jedis/connect.md index 5eaba4c4f2..530660f395 100644 --- a/content/develop/clients/jedis/connect.md +++ b/content/develop/clients/jedis/connect.md @@ -192,7 +192,7 @@ client.get("city"); // Retrieved from cache ``` You can see the cache working if you connect to the same Redis database -with [`redis-cli`]({{< relref "/develop/connect/cli" >}}) and run the +with [`redis-cli`]({{< relref "/develop/tools/cli" >}}) and run the [`MONITOR`]({{< relref "/commands/monitor" >}}) command. If you run the code above but without passing `cacheConfig` during the connection, you should see the following in the CLI among the output from `MONITOR`: From 64437a0381efe6a8eb4e3ee47acc34b7dd56062e Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Mon, 11 Nov 2024 15:50:10 +0000 Subject: [PATCH 14/17] DOC-4543 fixed remaining broken links --- content/apis/_index.md | 2 +- content/commands/client-getredir/index.md | 2 +- content/commands/client-tracking/index.md | 2 +- content/develop/clients/_index.md | 4 ++-- content/develop/data-types/timeseries/clients.md | 2 +- content/develop/get-started/data-store.md | 2 +- content/develop/get-started/document-database.md | 2 +- content/develop/get-started/vector-database.md | 2 +- content/develop/interact/search-and-query/_index.md | 2 +- content/develop/tools/_index.md | 2 +- content/develop/tools/insight/_index.md | 4 ++-- content/embeds/rc-rs-oss-compatibility.md | 2 +- content/get-started/_index.md | 2 +- content/integrate/amazon-bedrock/set-up-redis.md | 2 +- .../redis-data-integration/data-pipelines/deploy.md | 2 +- .../installation/install-k8s.md | 4 ++-- .../installation/install-vm.md | 2 +- .../redis-data-integration/quick-start-guide.md | 6 +++--- content/integrate/redis-py/_index.md | 2 +- content/integrate/redisom-for-java/_index.md | 2 +- .../oss_and_stack/install/install-redis/_index.md | 2 +- .../install/install-redis/install-redis-on-linux.md | 4 ++-- .../install/install-redis/install-redis-on-mac-os.md | 4 ++-- .../install-redis/install-redis-on-windows.md | 4 ++-- .../oss_and_stack/install/install-stack/linux.md | 4 ++-- .../oss_and_stack/install/install-stack/mac-os.md | 4 ++-- content/operate/oss_and_stack/management/scaling.md | 2 +- .../deprecated-features/graph/graph-quickstart.md | 2 +- .../triggers-and-functions/Quick_Start_RI.md | 2 +- content/operate/rc/databases/connect.md | 12 ++++++------ content/operate/rc/databases/flush-data.md | 2 +- content/operate/rc/databases/monitor-performance.md | 2 +- content/operate/rc/rc-quickstart.md | 10 +++++----- content/operate/rc/resilient-apps.md | 8 ++++---- .../data-access-control/default-user.md | 2 +- content/operate/redisinsight/_index.md | 2 +- content/operate/rs/databases/connect/_index.md | 2 +- .../databases/connect/supported-clients-browsers.md | 4 ++-- .../rs/databases/connect/test-client-connectivity.md | 6 +++--- .../rs/references/cli-utilities/redis-cli/_index.md | 2 +- .../rs/references/client_references/_index.md | 4 ++-- .../ldap/migrate-to-role-based-ldap.md | 2 +- 42 files changed, 68 insertions(+), 68 deletions(-) diff --git a/content/apis/_index.md b/content/apis/_index.md index 32d1a8ec0e..0b3243d45c 100644 --- a/content/apis/_index.md +++ b/content/apis/_index.md @@ -18,7 +18,7 @@ Redis comes with a wide range of commands that help you to develop real-time app As a developer, you will likely use one of our supported client libraries for connecting and executing commands. -- [Connect with Redis clients introduction]({{< relref "/develop/connect/clients/" >}}) +- [Connect with Redis clients introduction]({{< relref "/develop/clients" >}}) ### Programmability APIs diff --git a/content/commands/client-getredir/index.md b/content/commands/client-getredir/index.md index f596eb21b9..0d43ecd498 100644 --- a/content/commands/client-getredir/index.md +++ b/content/commands/client-getredir/index.md @@ -31,7 +31,7 @@ syntax_str: '' title: CLIENT GETREDIR --- This command returns the client ID we are redirecting our -[tracking]({{< relref "/develop/connect/clients/client-side-caching#tracking" >}}) notifications to. We set a client +[tracking]({{< relref "/develop/clients/client-side-caching#tracking" >}}) notifications to. We set a client to redirect to when using [`CLIENT TRACKING`]({{< relref "/commands/client-tracking" >}}) to enable tracking. However in order to avoid forcing client libraries implementations to remember the ID notifications are redirected to, this command exists in order to improve diff --git a/content/commands/client-tracking/index.md b/content/commands/client-tracking/index.md index 9c91fc8653..3146cc84eb 100644 --- a/content/commands/client-tracking/index.md +++ b/content/commands/client-tracking/index.md @@ -75,7 +75,7 @@ syntax_str: "[REDIRECT\_client-id] [PREFIX\_prefix [PREFIX prefix ...]] [BCAST] title: CLIENT TRACKING --- This command enables the tracking feature of the Redis server, that is used -for [server assisted client side caching]({{< relref "/develop/connect/clients/client-side-caching#tracking" >}}). +for [server assisted client side caching]({{< relref "/develop/clients/client-side-caching#tracking" >}}). When tracking is enabled Redis remembers the keys that the connection requested, in order to send later invalidation messages when such keys are diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index 523789fae1..5313957b1f 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -33,7 +33,7 @@ for six main languages: | [PHP](https://www.php.net/)| [`Predis`](https://github.com/predis/predis) | [PHP guide]({{< relref "/develop/clients/php" >}}) | No | We also provide several higher-level -[object mapping (OM)]({{< relref "/develop/connect/clients/om-clients" >}}) +[object mapping (OM)]({{< relref "/develop/clients/om-clients" >}}) libraries for [Python]({{< relref "/integrate/redisom-for-python" >}}), [C#/.NET]({{< relref "/integrate/redisom-for-net" >}}), [Node.js]({{< relref "/integrate/redisom-for-node-js" >}}), and @@ -59,4 +59,4 @@ You can experiment with a local installation of Redis Stack (see [Install Redis Stack]({{< relref "/operate/oss_and_stack/install/install-stack/" >}})) or with a free trial of [Redis Cloud]({{< relref "/operate/rc" >}}). To interact with a Redis server without writing code, use the [Redis CLI]({{< relref "/develop/tools/cli" >}}) and -[Redis Insight]({{< relref "/develop/connect/insight" >}}) tools. +[Redis Insight]({{< relref "/develop/tools/insight" >}}) tools. diff --git a/content/develop/data-types/timeseries/clients.md b/content/develop/data-types/timeseries/clients.md index de2270860a..6aafd15239 100644 --- a/content/develop/data-types/timeseries/clients.md +++ b/content/develop/data-types/timeseries/clients.md @@ -21,7 +21,7 @@ The table below shows the client libraries that support Redis time series: | Language | Client | | :-- | :-- | -| Python | [redis-py]({{< relref "/develop/connect/clients/python" >}}) | +| Python | [redis-py]({{< relref "/develop/clients/redis-py" >}}) | | JavaScript | [node-redis]({{< relref "/develop/clients/nodejs" >}}) | | Java | [Jedis]({{< relref "/develop/clients/jedis" >}}) | | C#/.NET | [NRedisStack]({{< relref "/develop/clients/dotnet" >}}) | diff --git a/content/develop/get-started/data-store.md b/content/develop/get-started/data-store.md index 2315809cc5..1fbb8ec887 100644 --- a/content/develop/get-started/data-store.md +++ b/content/develop/get-started/data-store.md @@ -37,7 +37,7 @@ You can alternatively follow the [installation guides]({{< relref "/operate/oss_ ## Connect -The first step is to connect to Redis. You can find further details about the connection options in this documentation site's [connection section]({{< relref "/develop/connect" >}}). The following example shows how to connect to a Redis server that runs on localhost (`-h 127.0.0.1`) and listens on the default port (`-p 6379`): +The first step is to connect to Redis. You can find further details about the connection options in this documentation site's [Tools section]({{< relref "/develop/tools" >}}). The following example shows how to connect to a Redis server that runs on localhost (`-h 127.0.0.1`) and listens on the default port (`-p 6379`): {{< clients-example search_quickstart connect >}} > redis-cli -h 127.0.0.1 -p 6379 diff --git a/content/develop/get-started/document-database.md b/content/develop/get-started/document-database.md index c128b83e04..4904a7537d 100644 --- a/content/develop/get-started/document-database.md +++ b/content/develop/get-started/document-database.md @@ -51,7 +51,7 @@ You can alternatively use the [installation guides]({{< relref "/operate/oss_and ## Connect -The first step is to connect to your Redis Stack database. You can find further details about the connection options in this documentation site's [connection section]({{< relref "/develop/connect" >}}). The following example shows how to connect to a Redis Stack server that runs on localhost (`-h 127.0.0.1`) and listens on the default port (`-p 6379`): +The first step is to connect to your Redis Stack database. You can find further details about the connection options in this documentation site's [Tools section]({{< relref "/develop/tools" >}}). The following example shows how to connect to a Redis Stack server that runs on localhost (`-h 127.0.0.1`) and listens on the default port (`-p 6379`): {{< clients-example search_quickstart connect >}} > redis-cli -h 127.0.0.1 -p 6379 diff --git a/content/develop/get-started/vector-database.md b/content/develop/get-started/vector-database.md index cfd739a57c..ec295eb77e 100644 --- a/content/develop/get-started/vector-database.md +++ b/content/develop/get-started/vector-database.md @@ -60,7 +60,7 @@ You need to have the following features configured for your Redis server: JSON a Create a Python virtual environment and install the following dependencies using `pip`: -* `redis`: You can find further details about the `redis-py` client library in the [clients]({{< relref "/develop/connect/clients/python" >}}) section of this documentation site. +* `redis`: You can find further details about the `redis-py` client library in the [clients]({{< relref "/develop/clients/redis-py" >}}) section of this documentation site. * `pandas`: Pandas is a data analysis library. * `sentence-transformers`: You will use the [SentenceTransformers](https://www.sbert.net/) framework to generate embeddings on full text. * `tabulate`: `pandas` uses `tabulate` to render Markdown. diff --git a/content/develop/interact/search-and-query/_index.md b/content/develop/interact/search-and-query/_index.md index 72f9373251..396feb6379 100644 --- a/content/develop/interact/search-and-query/_index.md +++ b/content/develop/interact/search-and-query/_index.md @@ -40,7 +40,7 @@ Here are the next steps to get you started: 1. Follow our [quick start guide]({{< relref "/develop/get-started/document-database" >}}) to get some initial hands-on experience. 1. Learn how to [create an index]({{< relref "/develop/interact/search-and-query/indexing/" >}}). 1. Learn how to [query your data]({{< relref "/develop/interact/search-and-query/query/" >}}). -1. [Install Redis Insight]({{< relref "/operate/redisinsight" >}}), connect it to your Redis database, and then use [Redis Copilot]({{< relref "/develop/connect/insight" >}}#redis-copilot) to help you learn how to execute complex queries against your own data using simple, plain language prompts. +1. [Install Redis Insight]({{< relref "/operate/redisinsight" >}}), connect it to your Redis database, and then use [Redis Copilot]({{< relref "/develop/tools/insight" >}}#redis-copilot) to help you learn how to execute complex queries against your own data using simple, plain language prompts. ## Enable the Redis Query Engine diff --git a/content/develop/tools/_index.md b/content/develop/tools/_index.md index c95f147a4b..0dd6b33c51 100644 --- a/content/develop/tools/_index.md +++ b/content/develop/tools/_index.md @@ -32,7 +32,7 @@ The [Redis command line interface]({{< relref "/develop/tools/cli" >}}) (also kn ## Redis Insight -[Redis Insight]({{< relref "/develop/connect/insight" >}}) combines a graphical user interface with Redis CLI to let you work with any Redis deployment. You can visually browse and interact with data, take advantage of diagnostic tools, learn by example, and much more. Best of all, Redis Insight is free. +[Redis Insight]({{< relref "/develop/tools/insight" >}}) combines a graphical user interface with Redis CLI to let you work with any Redis deployment. You can visually browse and interact with data, take advantage of diagnostic tools, learn by example, and much more. Best of all, Redis Insight is free. ## Redis VSCode extension diff --git a/content/develop/tools/insight/_index.md b/content/develop/tools/insight/_index.md index 3cecccf296..8b9e57d5bc 100644 --- a/content/develop/tools/insight/_index.md +++ b/content/develop/tools/insight/_index.md @@ -57,11 +57,11 @@ Here's an example of using Redis Copilot to search data using a simple, natural -See the [Redis Insight Copilot FAQ]({{< relref "/develop/connect/insight/copilot-faq" >}}) for more information. +See the [Redis Insight Copilot FAQ]({{< relref "/develop/tools/insight/copilot-faq" >}}) for more information. ### RDI in Redis Insight -Redis Insight includes Redis Data Integration (RDI) connectivity, which allows you to connect to an RDI management plane, and create, test, and deploy RDI pipelines. Read more about this feature [here]({{< relref "/develop/connect/insight/rdi-connector" >}}). +Redis Insight includes Redis Data Integration (RDI) connectivity, which allows you to connect to an RDI management plane, and create, test, and deploy RDI pipelines. Read more about this feature [here]({{< relref "/develop/tools/insight/rdi-connector" >}}). ### Browser diff --git a/content/embeds/rc-rs-oss-compatibility.md b/content/embeds/rc-rs-oss-compatibility.md index f0b196560d..9016262b4d 100644 --- a/content/embeds/rc-rs-oss-compatibility.md +++ b/content/embeds/rc-rs-oss-compatibility.md @@ -10,4 +10,4 @@ See [Compatibility with Redis commands]({{< relref "/operate/rs/references/compa ## Redis clients -You can use any standard [Redis client]({{< relref "/develop/connect/clients/" >}}) with Redis Enterprise Software and Redis Cloud. \ No newline at end of file +You can use any standard [Redis client]({{< relref "/develop/clients" >}}) with Redis Enterprise Software and Redis Cloud. \ No newline at end of file diff --git a/content/get-started/_index.md b/content/get-started/_index.md index 3864059871..ed9fe4e19a 100644 --- a/content/get-started/_index.md +++ b/content/get-started/_index.md @@ -27,7 +27,7 @@ The following quick start guides will show you how to use Redis for the followin - [Retrieval Augmented Generation (RAG) with Redis]({{< relref "/develop/get-started/rag" >}}) ## Data integration tools, libraries, and frameworks -- [Client API libraries]({{< relref "/develop/connect/clients" >}}) +- [Client API libraries]({{< relref "/develop/clients" >}}) - [Redis Data Integration]({{< relref "/integrate/redis-data-integration/" >}}) - [Redis vector library for Python]({{< relref "/integrate/redisvl/" >}}) - [Redis Cloud with Amazon Bedrock]({{< relref "/integrate/amazon-bedrock/" >}}) diff --git a/content/integrate/amazon-bedrock/set-up-redis.md b/content/integrate/amazon-bedrock/set-up-redis.md index b0ade9d8c6..79a00711d7 100644 --- a/content/integrate/amazon-bedrock/set-up-redis.md +++ b/content/integrate/amazon-bedrock/set-up-redis.md @@ -196,7 +196,7 @@ After your Redis Cloud database is set up, create a search index with a vector f ### Redis Insight -[Redis Insight]({{< relref "/develop/connect/insight/" >}}) is a free Redis GUI that allows you to visualize and optimize your data in Redis. +[Redis Insight]({{< relref "/develop/tools/insight" >}}) is a free Redis GUI that allows you to visualize and optimize your data in Redis. To create your vector index in Redis Insight: diff --git a/content/integrate/redis-data-integration/data-pipelines/deploy.md b/content/integrate/redis-data-integration/data-pipelines/deploy.md index 438f15ad56..88e3dcfc45 100644 --- a/content/integrate/redis-data-integration/data-pipelines/deploy.md +++ b/content/integrate/redis-data-integration/data-pipelines/deploy.md @@ -64,4 +64,4 @@ command to deploy them: redis-di deploy --dir ``` -You can also deploy a pipeline using [Redis Insight]({{< relref "/develop/connect/insight/rdi-connector" >}}). +You can also deploy a pipeline using [Redis Insight]({{< relref "/develop/tools/insight/rdi-connector" >}}). diff --git a/content/integrate/redis-data-integration/installation/install-k8s.md b/content/integrate/redis-data-integration/installation/install-k8s.md index 00b3207ae0..a2a5915e71 100644 --- a/content/integrate/redis-data-integration/installation/install-k8s.md +++ b/content/integrate/redis-data-integration/installation/install-k8s.md @@ -451,7 +451,7 @@ collector-api- 1/1 Running 0 29m ``` You can verify that the RDI API works by adding the server in -[Redis Insight]({{< relref "/develop/connect/insight/rdi-connector" >}}). +[Redis Insight]({{< relref "/develop/tools/insight/rdi-connector" >}}). ## Prepare your source database @@ -466,4 +466,4 @@ you are ready to start using RDI. See the guides to [configuring]({{< relref "/integrate/redis-data-integration/data-pipelines/data-pipelines" >}}) and [deploying]({{< relref "/integrate/redis-data-integration/data-pipelines/deploy" >}}) RDI pipelines for more information. You can also configure and deploy a pipeline -using [Redis Insight]({{< relref "/develop/connect/insight/rdi-connector" >}}). +using [Redis Insight]({{< relref "/develop/tools/insight/rdi-connector" >}}). diff --git a/content/integrate/redis-data-integration/installation/install-vm.md b/content/integrate/redis-data-integration/installation/install-vm.md index 43a23e9185..469c9b6293 100644 --- a/content/integrate/redis-data-integration/installation/install-vm.md +++ b/content/integrate/redis-data-integration/installation/install-vm.md @@ -339,7 +339,7 @@ you are ready to start using RDI. See the guides to [configuring]({{< relref "/integrate/redis-data-integration/data-pipelines/data-pipelines" >}}) and [deploying]({{< relref "/integrate/redis-data-integration/data-pipelines/deploy" >}}) RDI pipelines for more information. You can also configure and deploy a pipeline -using [Redis Insight]({{< relref "/develop/connect/insight/rdi-connector" >}}). +using [Redis Insight]({{< relref "/develop/tools/insight/rdi-connector" >}}). ## Uninstall RDI diff --git a/content/integrate/redis-data-integration/quick-start-guide.md b/content/integrate/redis-data-integration/quick-start-guide.md index df7d4b1108..0717daee80 100644 --- a/content/integrate/redis-data-integration/quick-start-guide.md +++ b/content/integrate/redis-data-integration/quick-start-guide.md @@ -15,7 +15,7 @@ In this tutorial you will learn how to install RDI and set up a pipeline to inge - A Redis Enterprise database that will serve as the pipeline target. The dataset that will be ingested is quite small in size, so a single shard database should be enough. RDI also needs to maintain its own database on the cluster to store state information. *This requires Redis Enterprise v6.4 or greater*. -- [Redis Insight]({{< relref "/develop/connect/insight/" >}}) +- [Redis Insight]({{< relref "/develop/tools/insight" >}}) to edit your pipeline - A virtual machine (VM) with one of the following operating systems: - Ubuntu 20.04 or 22.04 @@ -112,7 +112,7 @@ contexts. ### Deploy the pipeline -You can use [Redis Insight]({{< relref "/develop/connect/insight/rdi-connector" >}}) +You can use [Redis Insight]({{< relref "/develop/tools/insight/rdi-connector" >}}) to deploy the pipeline by adding a connection to the RDI API endpoint (which has the same IP address as your RDI VM and uses port 8083) and then clicking the **Deploy** button. You can also deploy it with the following command: @@ -149,4 +149,4 @@ To see the RDI pipeline working in CDC mode: - Run [`redis-di status --live`]({{< relref "/integrate/redis-data-integration/reference/cli/redis-di-status" >}}) to see the flow of records. -- User [Redis Insight]({{< relref "/develop/connect/insight" >}}) to look at the data in the target database. +- User [Redis Insight]({{< relref "/develop/tools/insight" >}}) to look at the data in the target database. diff --git a/content/integrate/redis-py/_index.md b/content/integrate/redis-py/_index.md index a59b6fa57f..ec71ffdf81 100644 --- a/content/integrate/redis-py/_index.md +++ b/content/integrate/redis-py/_index.md @@ -18,4 +18,4 @@ weight: 1 Connect your Python application to a Redis database using the redis-py client library. -Refer to the complete [Python guide]({{< relref "/develop/connect/clients/python" >}}) to install, connect, and use redis-py. +Refer to the complete [Python guide]({{< relref "/develop/clients/redis-py" >}}) to install, connect, and use redis-py. diff --git a/content/integrate/redisom-for-java/_index.md b/content/integrate/redisom-for-java/_index.md index bff5f89740..c084e386a8 100644 --- a/content/integrate/redisom-for-java/_index.md +++ b/content/integrate/redisom-for-java/_index.md @@ -25,7 +25,7 @@ Redis OM Spring provides a robust repository and custom object-mapping abstracti ## What you’ll need: * Redis Stack: See [{{< relref "/operate/oss_and_stack/install/install-stack/" >}}]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) -* [Redis Insight]({{< relref "/develop/connect/insight/" >}}) +* [Redis Insight]({{< relref "/develop/tools/insight" >}}) * Your favorite browser * Java 11 or greater diff --git a/content/operate/oss_and_stack/install/install-redis/_index.md b/content/operate/oss_and_stack/install/install-redis/_index.md index 28e123b93b..307f02cb98 100644 --- a/content/operate/oss_and_stack/install/install-redis/_index.md +++ b/content/operate/oss_and_stack/install/install-redis/_index.md @@ -66,7 +66,7 @@ Note that a Redis instance exposed to the internet without any security [is very Of course using Redis just from the command line interface is not enough as the goal is to use it from your application. To do so, you need to download and install a Redis client library for your programming language. -You'll find a [full list of supported clients for different languages in this page]({{< relref "develop/connect/clients/" >}}). +You'll find a [full list of supported clients for different languages in this page]({{< relref "develop/clients/" >}}). ## Redis persistence diff --git a/content/operate/oss_and_stack/install/install-redis/install-redis-on-linux.md b/content/operate/oss_and_stack/install/install-redis/install-redis-on-linux.md index c252ae0ad3..246fe3ae41 100644 --- a/content/operate/oss_and_stack/install/install-redis/install-redis-on-linux.md +++ b/content/operate/oss_and_stack/install/install-redis/install-redis-on-linux.md @@ -97,14 +97,14 @@ PONG {{< / highlight >}} You can also test that your Redis server is running using -[Redis Insight]({{< relref "/develop/connect/insight" >}}). +[Redis Insight]({{< relref "/develop/tools/insight" >}}). ## Next steps Once you have a running Redis instance, you may want to: * Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) -* Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) +* Connect using one of the [Redis clients]({{< relref "/develop/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. diff --git a/content/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os.md b/content/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os.md index 604a6fee71..01ff568968 100644 --- a/content/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os.md +++ b/content/operate/oss_and_stack/install/install-redis/install-redis-on-mac-os.md @@ -90,14 +90,14 @@ PONG {{< / highlight >}} You can also test that your Redis server is running using -[Redis Insight]({{< relref "/develop/connect/insight" >}}). +[Redis Insight]({{< relref "/develop/tools/insight" >}}). ## Next steps Once you have a running Redis instance, you may want to: * Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) -* Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) +* Connect using one of the [Redis clients]({{< relref "/develop/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. \ No newline at end of file diff --git a/content/operate/oss_and_stack/install/install-redis/install-redis-on-windows.md b/content/operate/oss_and_stack/install/install-redis/install-redis-on-windows.md index 054c572d4a..1ddf3ef398 100644 --- a/content/operate/oss_and_stack/install/install-redis/install-redis-on-windows.md +++ b/content/operate/oss_and_stack/install/install-redis/install-redis-on-windows.md @@ -54,13 +54,13 @@ PONG {{< / highlight >}} You can also test that your Redis server is running using -[Redis Insight]({{< relref "/develop/connect/insight" >}}). +[Redis Insight]({{< relref "/develop/tools/insight" >}}). ## Next steps Once you have a running Redis instance, you may want to: * Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) -* Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) +* Connect using one of the [Redis clients]({{< relref "/develop/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. diff --git a/content/operate/oss_and_stack/install/install-stack/linux.md b/content/operate/oss_and_stack/install/install-stack/linux.md index e87e74a9bd..eb5197f024 100644 --- a/content/operate/oss_and_stack/install/install-stack/linux.md +++ b/content/operate/oss_and_stack/install/install-stack/linux.md @@ -191,13 +191,13 @@ PONG {{< / highlight >}} You can also test that your Redis server is running using -[Redis Insight]({{< relref "/develop/connect/insight" >}}). +[Redis Insight]({{< relref "/develop/tools/insight" >}}). ## Next steps Once you have a running Redis instance, you may want to: * Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) -* Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) +* Connect using one of the [Redis clients]({{< relref "/develop/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. diff --git a/content/operate/oss_and_stack/install/install-stack/mac-os.md b/content/operate/oss_and_stack/install/install-stack/mac-os.md index 7f464ba4fd..d5a5de2747 100644 --- a/content/operate/oss_and_stack/install/install-stack/mac-os.md +++ b/content/operate/oss_and_stack/install/install-stack/mac-os.md @@ -134,13 +134,13 @@ PONG {{< / highlight >}} You can also test that your Redis server is running using -[Redis Insight]({{< relref "/develop/connect/insight" >}}). +[Redis Insight]({{< relref "/develop/tools/insight" >}}). ## Next steps Once you have a running Redis instance, you may want to: * Try the [Redis CLI tutorial]({{< relref "/develop/tools/cli" >}}) -* Connect using one of the [Redis clients]({{< relref "/develop/connect/clients" >}}) +* Connect using one of the [Redis clients]({{< relref "/develop/clients" >}}) * [Install Redis "properly"]({{< relref "/operate/oss_and_stack/install/install-redis#install-redis-properly" >}}) for production use. diff --git a/content/operate/oss_and_stack/management/scaling.md b/content/operate/oss_and_stack/management/scaling.md index 091ffc315b..5886842dd4 100644 --- a/content/operate/oss_and_stack/management/scaling.md +++ b/content/operate/oss_and_stack/management/scaling.md @@ -326,7 +326,7 @@ to run the script. #### Interact with the cluster To connect to Redis Cluster, you'll need a cluster-aware Redis client. -See the [documentation]({{< relref "/develop/connect/clients/" >}}) for your client of choice to determine its cluster support. +See the [documentation]({{< relref "/develop/clients" >}}) for your client of choice to determine its cluster support. You can also test your Redis Cluster using the `redis-cli` command line utility: diff --git a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/graph-quickstart.md b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/graph-quickstart.md index 857d9891dd..676ff34d15 100644 --- a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/graph-quickstart.md +++ b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/graph/graph-quickstart.md @@ -215,7 +215,7 @@ Alex's updated friend count: [[1]] ## Visualize graphs with Redis Insight -You can use the [Redis Insight]({{< relref "/develop/connect/insight/" >}}) workbench to visualize the relationships between the nodes of your graph. +You can use the [Redis Insight]({{< relref "/develop/tools/insight" >}}) workbench to visualize the relationships between the nodes of your graph. 1. Connect to your database with Redis Insight. You can [connect manually]({{< baseurl >}}/develop/connect/insight/#add-a-standalone-redis-database) or use the [auto-discovery]({{< baseurl >}}/develop/connect/insight/#auto-discovery-for-redis-cloud-databases) feature. diff --git a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_RI.md b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_RI.md index c498084ad5..0c0e9cadfd 100644 --- a/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_RI.md +++ b/content/operate/oss_and_stack/stack-with-enterprise/deprecated-features/triggers-and-functions/Quick_Start_RI.md @@ -19,7 +19,7 @@ aliases: Make sure that you have [Redis Stack installed]({{< relref "/operate/oss_and_stack/install/install-stack/" >}}) and running. Alternatively, you can create a [free Redis Cloud account](https://redis.com/try-free/?utm_source=redisio&utm_medium=referral&utm_campaign=2023-09-try_free&utm_content=cu-redis_cloud_users). -If you haven't already installed Redis Insight, you can download the latest version [here](https://redis.com/redis-enterprise/redis-insight/?_ga=2.232184223.127667221.1704724457-86137583.1685485233&_gl=1*1gygred*_ga*ODYxMzc1ODMuMTY4NTQ4NTIzMw..*_ga_8BKGRQKRPV*MTcwNDkyMzExMC40MDEuMS4xNzA0OTI3MjQ2LjUyLjAuMA..*_gcl_au*MTQzODY1OTU4OS4xNzAxMTg0MzY0). If this is your first time using Redis Insight, you may wish to read through the [Redis Insight guide]({{< relref "/develop/connect/insight/" >}}) before continuing with this guide. +If you haven't already installed Redis Insight, you can download the latest version [here](https://redis.com/redis-enterprise/redis-insight/?_ga=2.232184223.127667221.1704724457-86137583.1685485233&_gl=1*1gygred*_ga*ODYxMzc1ODMuMTY4NTQ4NTIzMw..*_ga_8BKGRQKRPV*MTcwNDkyMzExMC40MDEuMS4xNzA0OTI3MjQ2LjUyLjAuMA..*_gcl_au*MTQzODY1OTU4OS4xNzAxMTg0MzY0). If this is your first time using Redis Insight, you may wish to read through the [Redis Insight guide]({{< relref "/develop/tools/insight" >}}) before continuing with this guide. ## Connect to Redis Stack diff --git a/content/operate/rc/databases/connect.md b/content/operate/rc/databases/connect.md index 11da92254f..35b3796995 100644 --- a/content/operate/rc/databases/connect.md +++ b/content/operate/rc/databases/connect.md @@ -35,19 +35,19 @@ The connection wizard provides the following database connection methods: ## Redis Insight {#using-redisinsight} -[Redis Insight]({{< relref "/develop/connect/insight/" >}}) is a free Redis GUI that is available for macOS, Windows, and Linux. +[Redis Insight]({{< relref "/develop/tools/insight" >}}) is a free Redis GUI that is available for macOS, Windows, and Linux. 1. If you haven't downloaded Redis Insight, select **Download** under **Redis Insight** in the Connection wizard to download it. -1. [Install Redis Insight]({{< relref "/develop/connect/insight/" >}}). +1. [Install Redis Insight]({{< relref "/develop/tools/insight" >}}). 1. Once installed, select **Open with Redis Insight**. 1. A pop-up asks if you wish to open the link with Redis Insight. Select **Open Redis Insight** to connect to your database with Redis Insight. -If you get an error when connecting with Redis Insight, [manually connect to your database]({{< relref "/develop/connect/insight/" >}}) from Redis Insight. +If you get an error when connecting with Redis Insight, [manually connect to your database]({{< relref "/develop/tools/insight" >}}) from Redis Insight. -You can use Redis Insight to view your data, run Redis commands, and analyze database performance. See the [Redis Insight docs]({{< relref "/develop/connect/insight/" >}}) for more info. +You can use Redis Insight to view your data, run Redis commands, and analyze database performance. See the [Redis Insight docs]({{< relref "/develop/tools/insight" >}}) for more info. ## Redis client {#using-redis-client} @@ -64,7 +64,7 @@ The connection wizard provides code snippets to connect to your database with th If the username and password are not already filled in, replace `` and `` with your username and password. -See [Clients]({{< relref "/develop/connect/clients/" >}}) to learn how to connect with the official Redis clients. +See [Clients]({{< relref "/develop/clients" >}}) to learn how to connect with the official Redis clients. ### redis-cli {#using-rediscli} @@ -76,7 +76,7 @@ See [Redis CLI]({{< relref "/develop/tools/cli" >}}) to learn how to use `redis- ## More info -- [Connect your application]({{< relref "/develop/connect/clients/" >}}) +- [Connect your application]({{< relref "/develop/clients" >}}) - [Connect with TLS]({{< relref "/operate/rc/security/database-security/tls-ssl#connect-over-tls" >}}) - [Default user]({{< relref "/operate/rc/security/access-control/data-access-control/default-user" >}}) - [Role-based access control]({{< relref "/operate/rc/security/access-control/data-access-control/role-based-access-control" >}}) \ No newline at end of file diff --git a/content/operate/rc/databases/flush-data.md b/content/operate/rc/databases/flush-data.md index 5c2f2e1d38..313c264b4b 100644 --- a/content/operate/rc/databases/flush-data.md +++ b/content/operate/rc/databases/flush-data.md @@ -47,7 +47,7 @@ redis-cli -h redis-12345.server.cloud.redislabs.example.com -p 12345 -a xyz flus ### Redis Insight -If you install [Redis Insight]({{< relref "/develop/connect/insight/" >}}) and [add your database]({{< relref "/operate/rc/rc-quickstart#using-redisinsight" >}}), you can use the Redis Insight workbench to run commands: +If you install [Redis Insight]({{< relref "/develop/tools/insight" >}}) and [add your database]({{< relref "/operate/rc/rc-quickstart#using-redisinsight" >}}), you can use the Redis Insight workbench to run commands: 1. Start Redis Insight and connect to your database. diff --git a/content/operate/rc/databases/monitor-performance.md b/content/operate/rc/databases/monitor-performance.md index 3913c0113e..73cd756380 100644 --- a/content/operate/rc/databases/monitor-performance.md +++ b/content/operate/rc/databases/monitor-performance.md @@ -59,7 +59,7 @@ Several metric graphs are available: | [Expired objects/sec]({{< relref "/operate/rs/references/metrics/database-operations#expired-objectssec" >}}) | Number of expired objects per second. An expired object is an object with expired TTL that was deleted from the database. | | [Hit ratio]({{< relref "/operate/rs/references/metrics/database-operations#hit-ratio" >}}) | Percent of operations on existing keys out of the total number database operations | -For more detailed analysis, consider using [Redis Insight]({{< relref "/develop/connect/insight/" >}}) or [Prometheus and Grafana]({{< relref "/integrate/prometheus-with-redis-cloud/" >}}). +For more detailed analysis, consider using [Redis Insight]({{< relref "/develop/tools/insight" >}}) or [Prometheus and Grafana]({{< relref "/integrate/prometheus-with-redis-cloud/" >}}). ## Configure metric alerts diff --git a/content/operate/rc/rc-quickstart.md b/content/operate/rc/rc-quickstart.md index fd3a22dd88..2c94686214 100644 --- a/content/operate/rc/rc-quickstart.md +++ b/content/operate/rc/rc-quickstart.md @@ -96,18 +96,18 @@ The connection wizard provides the following database connection methods: ### Redis Insight{#using-redisinsight} -[Redis Insight]({{< relref "/develop/connect/insight/" >}}) is a free Redis GUI that is available for macOS, Windows, and Linux. +[Redis Insight]({{< relref "/develop/tools/insight" >}}) is a free Redis GUI that is available for macOS, Windows, and Linux. 1. In the connection wizard, under **Redis Insight**, select **Download** to download Redis Insight. -1. [Install Redis Insight]({{< relref "/develop/connect/insight/" >}}). +1. [Install Redis Insight]({{< relref "/develop/tools/insight" >}}). 1. Once installed, select **Open with Redis Insight**. 1. A pop-up asks if you wish to open the link with Redis Insight. Select **Open Redis Insight** to connect to your database with Redis Insight. -See the [Redis Insight docs]({{< relref "/develop/connect/insight/" >}}) for more info. +See the [Redis Insight docs]({{< relref "/develop/tools/insight" >}}) for more info. ### Redis client{#using-redis-client} @@ -122,7 +122,7 @@ The connection wizard provides code snippets to connect to your database with th {{The connection wizard clients.}} -See [Clients]({{< relref "/develop/connect/clients/" >}}) to learn how to connect with the official Redis clients. +See [Clients]({{< relref "/develop/clients" >}}) to learn how to connect with the official Redis clients. ### redis-cli {#using-rediscli} @@ -134,7 +134,7 @@ See [Redis CLI]({{< relref "/develop/tools/cli" >}}) to learn how to use `redis- ## More info -- [Connect your application]({{< relref "/develop/connect/clients/" >}}) +- [Connect your application]({{< relref "/develop/clients" >}}) - [Import data]({{< relref "/operate/rc/databases/import-data.md" >}}) - [Manage databases]({{< relref "/operate/rc/databases" >}}) - [Data persistence]({{< relref "/operate/rc/databases/configuration/data-persistence.md" >}}) diff --git a/content/operate/rc/resilient-apps.md b/content/operate/rc/resilient-apps.md index 1da2ea05ca..5622b0e8fb 100644 --- a/content/operate/rc/resilient-apps.md +++ b/content/operate/rc/resilient-apps.md @@ -58,19 +58,19 @@ A Redis Cloud Essentials database has a set maintenance window based on the regi When you're developing your apps, it is best to use specific Redis Client features to connect to Redis Cloud if they are available for your preferred client. -See [Clients]({{< relref "/develop/connect/clients/" >}}) to learn how to connect with the official Redis clients. +See [Clients]({{< relref "/develop/clients" >}}) to learn how to connect with the official Redis clients. ### Re-attempt connections Some clients allow you to re-try connecting to your database if the connection fails. For these clients, we recommend that you implement connection re-attempts to ensure high availability and connection stability. -View your [client's docs]({{< relref "/develop/connect/clients/" >}}) to learn more. +View your [client's docs]({{< relref "/develop/clients" >}}) to learn more. ### Refresh DNS Your application may disconnect from your database either during planned maintenance or for other, unplanned reasons. Most Redis clients are set to refresh their DNS address when they reconnect to the database, and you will not be required to perform any further action. If you encounter connectivity problems for more than a minute during maintenance then you should refresh your DNS entries. -Depending on the client, you may be recommended to turn off the DNS cache entirely. Refer to your [client's docs]({{< relref "/develop/connect/clients/" >}}) to learn more. +Depending on the client, you may be recommended to turn off the DNS cache entirely. Refer to your [client's docs]({{< relref "/develop/clients" >}}) to learn more. ### Use the WAIT and WAITAOF commands @@ -80,6 +80,6 @@ For more info, see [Use the WAIT command for strong consistency]({{< relref "/op ## More info -- [Redis Clients]({{< relref "/develop/connect/clients/" >}}) +- [Redis Clients]({{< relref "/develop/clients" >}}) - [Active-Active Redis]({{< relref "/operate/rc/databases/configuration/active-active-redis" >}}) - [Active-Active Redis applications]({{< relref "/operate/rs/databases/active-active/develop" >}}) \ No newline at end of file diff --git a/content/operate/rc/security/access-control/data-access-control/default-user.md b/content/operate/rc/security/access-control/data-access-control/default-user.md index f268077ef4..c89901aa71 100644 --- a/content/operate/rc/security/access-control/data-access-control/default-user.md +++ b/content/operate/rc/security/access-control/data-access-control/default-user.md @@ -23,7 +23,7 @@ Use the copy button to copy the password to the clipboard: You'll need to use this password whenever you connect to your database using a Redis client. See [Connect to a database]({{< relref "/operate/rc/databases/connect" >}}) for more info. -See your [Redis client's documentation]({{< relref "/develop/connect/clients/" >}}) to learn how to provide your password when connecting. +See your [Redis client's documentation]({{< relref "/develop/clients" >}}) to learn how to provide your password when connecting. ## Change password diff --git a/content/operate/redisinsight/_index.md b/content/operate/redisinsight/_index.md index dc2f95d0a2..61d124e7d8 100644 --- a/content/operate/redisinsight/_index.md +++ b/content/operate/redisinsight/_index.md @@ -4,4 +4,4 @@ description: Install and manage Redis Insight linkTitle: Redis Insight --- -For information on using Redis Insight, see [these pages]({{< relref "/develop/connect/insight" >}}). \ No newline at end of file +For information on using Redis Insight, see [these pages]({{< relref "/develop/tools/insight" >}}). \ No newline at end of file diff --git a/content/operate/rs/databases/connect/_index.md b/content/operate/rs/databases/connect/_index.md index 8a0a754351..4be90d67ba 100644 --- a/content/operate/rs/databases/connect/_index.md +++ b/content/operate/rs/databases/connect/_index.md @@ -29,6 +29,6 @@ Use one of the following connection methods to connect to your database: - [Redis Insight](https://redis.com/redis-enterprise/redis-insight/) -- [Redis client]({{< relref "/develop/connect/clients/" >}}) for your preferred programming language +- [Redis client]({{< relref "/develop/clients" >}}) for your preferred programming language For examples, see [Test client connection]({{< relref "/operate/rs/databases/connect/test-client-connectivity" >}}). \ No newline at end of file diff --git a/content/operate/rs/databases/connect/supported-clients-browsers.md b/content/operate/rs/databases/connect/supported-clients-browsers.md index e3678d6b5a..e20cf2eb8b 100644 --- a/content/operate/rs/databases/connect/supported-clients-browsers.md +++ b/content/operate/rs/databases/connect/supported-clients-browsers.md @@ -12,7 +12,7 @@ You can connect to Redis Enterprise Software databases programmatically using cl ## Redis client libraries -To connect an application to a Redis database hosted by Redis Enterprise Software, use a [client library]({{< relref "/develop/connect/clients/" >}}) appropriate for your programming language. +To connect an application to a Redis database hosted by Redis Enterprise Software, use a [client library]({{< relref "/develop/clients" >}}) appropriate for your programming language. You can also use the `redis-cli` utility to connect to a database from the command line. @@ -28,7 +28,7 @@ Note: You cannot use client libraries to configure Redis Enterprise Software. I We recommend the following clients when using a [discovery service]({{< relref "/operate/rs/databases/durability-ha/discovery-service.md" >}}) based on the Redis Sentinel API: -- [redis-py]({{< relref "/develop/connect/clients/python" >}}) (Python client) +- [redis-py]({{< relref "/develop/clients/redis-py" >}}) (Python client) - [NRedisStack]({{< relref "/develop/clients/dotnet" >}}) (.NET client) - [Jedis]({{< relref "/develop/clients/jedis" >}}) (synchronous Java client) - [Lettuce]({{< relref "/develop/clients/lettuce" >}}) (asynchronous Java client) diff --git a/content/operate/rs/databases/connect/test-client-connectivity.md b/content/operate/rs/databases/connect/test-client-connectivity.md index 807b9762fb..75f0649d6b 100644 --- a/content/operate/rs/databases/connect/test-client-connectivity.md +++ b/content/operate/rs/databases/connect/test-client-connectivity.md @@ -42,7 +42,7 @@ database and store data using one of the following methods: - [Redis Insight](https://redis.com/redis-enterprise/redis-insight/), a free Redis GUI that is available for macOS, Windows, and Linux -- An application using a Redis client library, such as [`redis-py`](https://github.com/redis/redis-py) for Python. See the [client list]({{< relref "/develop/connect/clients/" >}}) to view all Redis clients by language. +- An application using a Redis client library, such as [`redis-py`](https://github.com/redis/redis-py) for Python. See the [client list]({{< relref "/develop/clients" >}}) to view all Redis clients by language. ### Connect with redis-cli @@ -62,7 +62,7 @@ For more `redis-cli` connection examples, see the [`redis-cli` reference]({{< re Redis Insight is a free Redis GUI that is available for macOS, Windows, and Linux. -1. [Install Redis Insight]({{< relref "/develop/connect/insight/" >}}). +1. [Install Redis Insight]({{< relref "/develop/tools/insight" >}}). 1. Open Redis Insight and select **Add Redis Database**. @@ -72,7 +72,7 @@ Redis Insight is a free Redis GUI that is available for macOS, Windows, and Linu 1. Select **Add Redis Database** to connect to the database. -See the [Redis Insight documentation]({{< relref "/develop/connect/insight/" >}}) for more information. +See the [Redis Insight documentation]({{< relref "/develop/tools/insight" >}}) for more information. ### Connect with Python diff --git a/content/operate/rs/references/cli-utilities/redis-cli/_index.md b/content/operate/rs/references/cli-utilities/redis-cli/_index.md index 145ea587e7..18fd8cc140 100644 --- a/content/operate/rs/references/cli-utilities/redis-cli/_index.md +++ b/content/operate/rs/references/cli-utilities/redis-cli/_index.md @@ -15,7 +15,7 @@ weight: $weight The `redis-cli` command-line utility lets you interact with a Redis database. With `redis-cli`, you can run [Redis commands]({{< relref "/commands" >}}) directly from the command-line terminal or with [interactive mode](#interactive-mode). -If you want to run Redis commands without `redis-cli`, you can [connect to a database with Redis Insight]({{< relref "/develop/connect/insight/" >}}) and use the built-in [CLI]({{< relref "/develop/connect/insight/" >}}) prompt instead. +If you want to run Redis commands without `redis-cli`, you can [connect to a database with Redis Insight]({{< relref "/develop/tools/insight" >}}) and use the built-in [CLI]({{< relref "/develop/tools/insight" >}}) prompt instead. ## Install `redis-cli` diff --git a/content/operate/rs/references/client_references/_index.md b/content/operate/rs/references/client_references/_index.md index b49638869d..1c9c43022c 100644 --- a/content/operate/rs/references/client_references/_index.md +++ b/content/operate/rs/references/client_references/_index.md @@ -22,11 +22,11 @@ To connect to Redis instances from within your application, use a Redis client l | Go | [go-redis]({{< relref "/develop/clients/go" >}}) | | Java | [Jedis]({{< relref "/develop/clients/jedis" >}}) (Synchronous) and [Lettuce]({{< relref "/develop/clients/lettuce" >}}) (Asynchronous) | | Node.js | [node-redis]({{< relref "/develop/clients/nodejs" >}}) | -| Python | [redis-py]({{< relref "/develop/connect/clients/python" >}}) | +| Python | [redis-py]({{< relref "/develop/clients/redis-py" >}}) | Select a client name to see its quick start. ## Other clients For a list of community-driven Redis clients, which are available for more programming languages, see -[Community-supported clients]({{< relref "/develop/connect/clients#community-supported-clients" >}}). +[Community-supported clients]({{< relref "/develop/clients#community-supported-clients" >}}). diff --git a/content/operate/rs/security/access-control/ldap/migrate-to-role-based-ldap.md b/content/operate/rs/security/access-control/ldap/migrate-to-role-based-ldap.md index a708491ddc..797e3ea149 100644 --- a/content/operate/rs/security/access-control/ldap/migrate-to-role-based-ldap.md +++ b/content/operate/rs/security/access-control/ldap/migrate-to-role-based-ldap.md @@ -62,7 +62,7 @@ To test your LDAP integration, you can: - Sign in to the Cluster Manager UI using LDAP credentials authorized for admin access. -- Use [Redis Insight]({{< relref "/develop/connect/insight/" >}}) to access a database using authorized LDAP credentials. +- Use [Redis Insight]({{< relref "/develop/tools/insight" >}}) to access a database using authorized LDAP credentials. - Use the [REST API]({{< relref "/operate/rs/references/rest-api" >}}) to connect using authorized LDAP credentials. From 9e5fb11606db2a533b58064da8ac69e3f87a76b6 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Mon, 11 Nov 2024 16:18:49 +0000 Subject: [PATCH 15/17] DOC-4543 added aliases --- content/develop/clients/om-clients/_index.md | 1 + content/develop/tools/cli.md | 1 + content/develop/tools/insight/_index.md | 1 + content/develop/tools/insight/copilot-faq.md | 1 + content/develop/tools/insight/debugging.md | 1 + content/develop/tools/insight/rdi-connector.md | 1 + content/develop/tools/insight/release-notes/_index.md | 1 + .../develop/tools/insight/tutorials/insight-stream-consumer.md | 1 + content/develop/tools/redis-for-vscode/_index.md | 1 + 9 files changed, 9 insertions(+) diff --git a/content/develop/clients/om-clients/_index.md b/content/develop/clients/om-clients/_index.md index 3cb25e174a..d1902af7a9 100644 --- a/content/develop/clients/om-clients/_index.md +++ b/content/develop/clients/om-clients/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/om-clients categories: - docs - develop diff --git a/content/develop/tools/cli.md b/content/develop/tools/cli.md index 057116fe1f..ff07523d75 100644 --- a/content/develop/tools/cli.md +++ b/content/develop/tools/cli.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/cli categories: - docs - develop diff --git a/content/develop/tools/insight/_index.md b/content/develop/tools/insight/_index.md index 8b9e57d5bc..6a01462d3a 100644 --- a/content/develop/tools/insight/_index.md +++ b/content/develop/tools/insight/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/insight categories: - docs - develop diff --git a/content/develop/tools/insight/copilot-faq.md b/content/develop/tools/insight/copilot-faq.md index 35f8c03e05..81bbb0916d 100644 --- a/content/develop/tools/insight/copilot-faq.md +++ b/content/develop/tools/insight/copilot-faq.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/insight/copilot-faq categories: - docs - operate diff --git a/content/develop/tools/insight/debugging.md b/content/develop/tools/insight/debugging.md index 09dcb6f3b5..c604e02eae 100644 --- a/content/develop/tools/insight/debugging.md +++ b/content/develop/tools/insight/debugging.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/insight/debugging categories: - docs - develop diff --git a/content/develop/tools/insight/rdi-connector.md b/content/develop/tools/insight/rdi-connector.md index dc9ad64760..1cbc7a8507 100644 --- a/content/develop/tools/insight/rdi-connector.md +++ b/content/develop/tools/insight/rdi-connector.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/insight/rdi-connector categories: - docs - develop diff --git a/content/develop/tools/insight/release-notes/_index.md b/content/develop/tools/insight/release-notes/_index.md index 468135d813..f46184b5af 100644 --- a/content/develop/tools/insight/release-notes/_index.md +++ b/content/develop/tools/insight/release-notes/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/insight/release-notes categories: - docs - develop diff --git a/content/develop/tools/insight/tutorials/insight-stream-consumer.md b/content/develop/tools/insight/tutorials/insight-stream-consumer.md index 8c7b09a6d2..83b8685fbb 100644 --- a/content/develop/tools/insight/tutorials/insight-stream-consumer.md +++ b/content/develop/tools/insight/tutorials/insight-stream-consumer.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/insight/tutorials/insight-stream-consumer categories: - docs - develop diff --git a/content/develop/tools/redis-for-vscode/_index.md b/content/develop/tools/redis-for-vscode/_index.md index c221a060e6..2ce173b76d 100644 --- a/content/develop/tools/redis-for-vscode/_index.md +++ b/content/develop/tools/redis-for-vscode/_index.md @@ -1,4 +1,5 @@ --- +aliases: /develop/connect/redis-for-vscode categories: - docs - develop From daf2053e26c2120d72a06166716819e0b273f9a1 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Mon, 11 Nov 2024 16:31:56 +0000 Subject: [PATCH 16/17] DOC-4543 small fixes --- content/develop/clients/_index.md | 16 ++++++++-------- content/develop/tools/_index.md | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index 5313957b1f..c97194f439 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -12,7 +12,7 @@ categories: - clients hideListLinks: true description: Connect your application to a Redis database and try an example -linkTitle: Client APIs 👩🏻‍💻 +linkTitle: Client APIs title: Connect with Redis client API libraries weight: 30 --- @@ -23,14 +23,14 @@ for six main languages: | Language | Client name | Docs | Supported | | :-- | :-- | :-- | :-- | -| [Python](https://www.python.org/) | [`redis-py`](https://github.com/redis/redis-py) |[Redis Python library guide]({{< relref "/develop/clients/redis-py" >}}) | Yes | +| [Python](https://www.python.org/) | [`redis-py`](https://github.com/redis/redis-py) |[`redis-py` guide]({{< relref "/develop/clients/redis-py" >}}) | Yes | | [Python](https://www.python.org/) | [`RedisVL`](https://github.com/redis/redis-vl-python) |[RedisVL guide]({{< relref "/integrate/redisvl" >}}) | Yes -| [C#/.NET](https://learn.microsoft.com/en-us/dotnet/csharp/) | [`NRedisStack`](https://github.com/redis/NRedisStack) |[C#/.NET guide]({{< relref "/develop/clients/dotnet" >}}) | Yes | -| [Node.js](https://nodejs.org/en) | [`node-redis`](https://github.com/redis/node-redis) | [Node.js guide]({{< relref "/develop/clients/nodejs" >}}) | Yes | -| [Java](https://www.java.com/en/) | [`Jedis`](https://github.com/redis/jedis) | [Jedis guide]({{< relref "/develop/clients/jedis" >}}) | Yes | -| [Java](https://www.java.com/en/) | [`Lettuce`](https://github.com/redis/lettuce) | [Lettuce guide]({{< relref "/develop/clients/lettuce" >}}) | Yes | -| [Go](https://go.dev/) | [`go-redis`](https://github.com/redis/go-redis) | [Go guide]({{< relref "/develop/clients/go" >}}) | Yes | -| [PHP](https://www.php.net/)| [`Predis`](https://github.com/predis/predis) | [PHP guide]({{< relref "/develop/clients/php" >}}) | No | +| [C#/.NET](https://learn.microsoft.com/en-us/dotnet/csharp/) | [`NRedisStack`](https://github.com/redis/NRedisStack) |[`NRedisStack` guide]({{< relref "/develop/clients/dotnet" >}}) | Yes | +| [Node.js](https://nodejs.org/en) | [`node-redis`](https://github.com/redis/node-redis) | [`node-redis` guide]({{< relref "/develop/clients/nodejs" >}}) | Yes | +| [Java](https://www.java.com/en/) | [`Jedis`](https://github.com/redis/jedis) | [`Jedis` guide]({{< relref "/develop/clients/jedis" >}}) | Yes | +| [Java](https://www.java.com/en/) | [`Lettuce`](https://github.com/redis/lettuce) | [`Lettuce` guide]({{< relref "/develop/clients/lettuce" >}}) | Yes | +| [Go](https://go.dev/) | [`go-redis`](https://github.com/redis/go-redis) | [`go-redis` guide]({{< relref "/develop/clients/go" >}}) | Yes | +| [PHP](https://www.php.net/)| [`Predis`](https://github.com/predis/predis) | [`Predis` guide]({{< relref "/develop/clients/php" >}}) | No | We also provide several higher-level [object mapping (OM)]({{< relref "/develop/clients/om-clients" >}}) diff --git a/content/develop/tools/_index.md b/content/develop/tools/_index.md index 0dd6b33c51..a9421afacd 100644 --- a/content/develop/tools/_index.md +++ b/content/develop/tools/_index.md @@ -1,5 +1,6 @@ --- categories: +aliases: - docs - develop - stack @@ -12,7 +13,7 @@ categories: description: Tools to interact with a Redis server linkTitle: Client tools hideListLinks: true -title: Redis tools +title: Client tools weight: 25 --- @@ -21,7 +22,7 @@ manage it and interact with the data: * The [`redis-cli`](#redis-command-line-interface-cli) command line tool * [Redis Insight](#redis-insight) (a graphical user interface tool) -* The Redis VSCode extension +* The Redis [VSCode extension](#redis-vscode-extension) ## Redis command line interface (CLI) From ae4a2d2b6403ca13f8cec1ff319740eba229dfd7 Mon Sep 17 00:00:00 2001 From: andy-stark-redis <164213578+andy-stark-redis@users.noreply.github.com> Date: Tue, 12 Nov 2024 14:52:40 +0000 Subject: [PATCH 17/17] Update content/develop/clients/_index.md Co-authored-by: David Dougherty --- content/develop/clients/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/develop/clients/_index.md b/content/develop/clients/_index.md index c97194f439..15e5c410c1 100644 --- a/content/develop/clients/_index.md +++ b/content/develop/clients/_index.md @@ -26,7 +26,7 @@ for six main languages: | [Python](https://www.python.org/) | [`redis-py`](https://github.com/redis/redis-py) |[`redis-py` guide]({{< relref "/develop/clients/redis-py" >}}) | Yes | | [Python](https://www.python.org/) | [`RedisVL`](https://github.com/redis/redis-vl-python) |[RedisVL guide]({{< relref "/integrate/redisvl" >}}) | Yes | [C#/.NET](https://learn.microsoft.com/en-us/dotnet/csharp/) | [`NRedisStack`](https://github.com/redis/NRedisStack) |[`NRedisStack` guide]({{< relref "/develop/clients/dotnet" >}}) | Yes | -| [Node.js](https://nodejs.org/en) | [`node-redis`](https://github.com/redis/node-redis) | [`node-redis` guide]({{< relref "/develop/clients/nodejs" >}}) | Yes | +| [JavaScript](https://nodejs.org/en) | [`node-redis`](https://github.com/redis/node-redis) | [`node-redis` guide]({{< relref "/develop/clients/nodejs" >}}) | Yes | | [Java](https://www.java.com/en/) | [`Jedis`](https://github.com/redis/jedis) | [`Jedis` guide]({{< relref "/develop/clients/jedis" >}}) | Yes | | [Java](https://www.java.com/en/) | [`Lettuce`](https://github.com/redis/lettuce) | [`Lettuce` guide]({{< relref "/develop/clients/lettuce" >}}) | Yes | | [Go](https://go.dev/) | [`go-redis`](https://github.com/redis/go-redis) | [`go-redis` guide]({{< relref "/develop/clients/go" >}}) | Yes |