{
  "schema_version": 2,
  "id": "develop/data-types/json/path",
  "title": "Path",
  "url": "https://redis.io/docs/latest/develop/data-types/json/path/",
  "summary": "Access specific elements within a JSON document",
  "aliases": [
    "/stack/json/path",
    "/stack/json/path/"
  ],
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-10T15:45:45+01:00",
  "page_type": "content",
  "content_hash": "272b09be068c956ac905e7d250bb00172d1b7e40ae346bc6df56ffa5548793fd",
  "sections": [
    {
      "id": "jsonpath-support",
      "title": "JSONPath support",
      "role": "content",
      "text": "RedisJSON v2.0 introduced [JSONPath](http://goessner.net/articles/JsonPath/) support. It follows the syntax described by Goessner in his [article](http://goessner.net/articles/JsonPath/).\n\nA JSONPath query can resolve to several locations in a JSON document. In this case, the JSON commands apply the operation to every possible location. This is a major improvement over [legacy path](#legacy-path-syntax) queries, which only operate on the first path.\n\nNotice that the structure of the command response often differs when using JSONPath. See the [Commands](/commands/?group=json) page for more details.\n\nThe new syntax supports bracket notation, which allows the use of special characters like colon \":\" or whitespace in key names.\n\nIf you want to include double quotes in a query from the CLI, enclose the JSONPath within single quotes. For example:\n\n[code example]"
    },
    {
      "id": "jsonpath-syntax",
      "title": "JSONPath syntax",
      "role": "content",
      "text": "The following JSONPath syntax table was adapted from Goessner's [path syntax comparison](https://goessner.net/articles/JsonPath/index.html#e2).\n\n| Syntax&nbsp;element | Description |\n|----------------|-------------|\n| $ | The root (outermost JSON element), starts the path. |\n| . or [] | Selects a child element. |\n| .. | Recursively descends through the JSON document. |\n| * | Wildcard, returns all elements. |\n| [] | Subscript operator, accesses an array element. |\n| [,] | Union, selects multiple elements. |\n| [start\\:end\\:step] | Array slice where *start*, *end*, and *step* are index values. You can omit values from the slice (for example, `[3:]`, `[:8:2]`) to use the default values: *start* defaults to the first index, *end* defaults to the last index, and *step* defaults to `1`. Use `[*]` or `[:]` to select all elements. |\n| ?() | Filters a JSON object or array. Supports comparison operators <nobr>(`==`, `!=`, `<`, `<=`, `>`, `>=`, `=~`)</nobr>, logical operators <nobr>(`&&`, `\\|\\|`, `!`)</nobr>, arithmetic operators <nobr>(`+`, `-`, `*`, `/`, `%`)</nobr>, membership operators <nobr>(`in`, `nin`)</nobr>, set-relation operators <nobr>(`subsetof`, `anyof`, `noneof`)</nobr>, the <nobr>(`size`/`sizeof`, `empty`)</nobr> operators, and parenthesis <nobr>(`(`, `)`)</nobr>. |\n| () | Script expression. |\n| @ | The current element, used in filter or script expressions. |\n| ~ | Returns the names of an object's members as a list of strings. |\n\nBeginning with Redis 8.10, the JSON data type supports a richer JSONPath syntax, with additional operators and functions:\n\n- [Projection expressions](#projection-expressions) at the top level of a JSONPath query\n- [`==` and `!=`](#comparing-array-and-object-literals) can now compare any literal, including array and object literals\n- Filter negation operator: [`!`](#negation-)\n- [`size`/`sizeof` and `empty`](#size-sizeof-and-empty) operators on string, array, object, and nodelist\n- [`in` and `nin`](#membership-in-and-nin) operators: membership test on an array and nodelist\n- [Operators on numbers](#arithmetic-operators): binary `-`, `+`, `*`, `/`, `%`, and unary `-` and `+`\n- Operator on object: [`~`](#get-keys-operator-)\n- [`length()`](#length) function on array, object, and string\n- Functions on number: [`abs()`, `ceiling()`, `floor()`](#abs-ceiling-and-floor)\n- Functions on string: [`match()`, `search()`](#match-and-search)\n- Strings concatenation with [`concat()`](#concat)\n- Functions on array: [`first()`, `last()`, `index()`](#first-last-and-index), [`append()`](#append)\n- Aggregation functions on array: [`min()`, `max()`, `avg()`, `sum()`, `stddev()`](#min-max-avg-sum-and-stddev)\n- Function on object: [`keys()`](#keys)\n- Function on nodelist: [`count()`](#count)\n- Function on nodelist with exactly one node: [`value()`](#value)\n- Relations functions on array and nodelist: [`subsetof()`, `anyof()`, `noneof()`](#set-relations-subsetof-anyof-and-noneof)\n\nThese operators can be used within a filter expression (`?()`). Functions can appear inside filter expressions and, when they return a value, as top-level [projection expressions](#projection-expressions). A function can be written in prefix form, `length($.arr)`, or in postfix (method) form, `$.arr.length()`. A path segment immediately followed by `(` is a method call, so `$.arr.length()` is a function call while `$.arr.length` is a reference to a field named `length`.\n\n> [!WARNING]\n> Beginning with Redis 8.10, two changes to path parsing may affect existing queries:\n>\n> - To access a field whose name contains a tilde (`~`), use bracket notation, for example `$[\"a~b\"]`. A tilde is no longer valid in a field name using dot notation.\n> - The words `in`, `nin`, `subsetof`, `anyof`, `noneof`, `size`, `sizeof`, and `empty` are now reserved as operators. To access a field with one of these names, use `$.size` or `$[\"size\"]`."
    },
    {
      "id": "evaluation-semantics",
      "title": "Evaluation semantics",
      "role": "content",
      "text": "The following rules apply to the operators and functions described below:\n\n- **The \"Nothing\" result.** Any operand that cannot be evaluated — a non-numeric arithmetic operand, division or modulo by zero, an out-of-range index, a wrong argument count, a type mismatch, or an arithmetic overflow to a non-finite value — evaluates to *Nothing*. Inside a filter, a *Nothing* result makes the surrounding condition false, so the element is skipped. As a projection, it produces an empty reply (`[]`). Evaluation never returns an error and never fails the query for these cases.\n- **Number coercion.** The `==`, `!=`, `in`, `nin`, and set-relation operators treat integer and floating-point numbers with the same value as equal (for example, `1` equals `1.0`). The ordering operators (`<`, `<=`, `>`, `>=`) cannot compare against an array or object literal, so such a comparison never matches.\n- **Node lists match on \"any\".** When an operand selects more than one node (for example, `@.*`), a comparison or operator holds if *any* selected node satisfies it.\n- **Arithmetic operators must be surrounded by spaces.** `@.a + 1` is addition, but `@.a+1` is a reference to a field literally named `a+1`, because the field-name character set includes characters such as `+`, `-`, `/`, `%`, `$`, `^`, `:`, and `_`.\n- **Functions are arity-checked.** Calling a function with the wrong number of arguments produces *Nothing* rather than silently using a subset of the arguments."
    },
    {
      "id": "jsonpath-examples",
      "title": "JSONPath examples",
      "role": "content",
      "text": "The following examples use this JSON document, which stores details about items in a store's inventory:\n\n[code example]\n\nFirst, create the JSON document in your database:\n\nSetup: Create a complex JSON document with nested objects and arrays to use in JSONPath examples\n\n**Commands:** JSON.SET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]"
    },
    {
      "id": "access-examples",
      "title": "Access examples",
      "role": "content",
      "text": "The following examples use the [`JSON.GET`](https://redis.io/docs/latest/commands/json.get) command to retrieve data from various paths in the JSON document.\n\nYou can use the wildcard operator `*` to return a list of all items in the inventory:\n\nWildcard queries: Use the * operator to retrieve all items in a collection when you need to access all elements at a specific level\n\n**Builds upon:** set_bikes\n\n**Commands:** JSON.GET\n\n**Complexity:**\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nFor some queries, multiple paths can produce the same results. For example, the following paths return the names of all mountain bikes:\n\nArray element access: Use bracket notation and array subscripts to access specific array elements or all elements with [*] when you need to retrieve values from arrays\n\n**Difficulty:** Intermediate\n\n**Builds upon:** get_bikes\n\n**Commands:** JSON.GET\n\n**Complexity:**\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nThe recursive descent operator `..` can retrieve a field from multiple sections of a JSON document. The following example returns the names of all inventory items:\n\nRecursive descent: Use the .. operator to search for a field at any depth in the JSON document when you need to find values across multiple nesting levels\n\n**Difficulty:** Intermediate\n\n**Builds upon:** get_mtnbikes\n\n**Commands:** JSON.GET\n\n**Complexity:**\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nYou can use an array slice to select a range of elements from an array. This example returns the names of the first 2 mountain bikes:\n\nArray slicing: Use [start:end] syntax to select a range of array elements when you need to retrieve a subset of items from an array\n\n**Difficulty:** Intermediate\n\n**Builds upon:** get_mtnbikes\n\n**Commands:** JSON.GET\n\n**Complexity:**\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nFilter expressions `?()` let you select JSON elements based on certain conditions. You can use comparison operators (`==`, `!=`, `<`, `<=`, `>`, `>=`, and starting with version v2.4.2, also `=~`), logical operators (`&&`, `||`), and parenthesis (`(`, `)`) within these expressions. A filter expression can be applied on an array or on an object, iterating over all the **elements** in the array or all the **values** in the object, retrieving only the ones that match the filter condition. \n\nPaths within the filter condition use the dot notation with either `@` to denote the current array element or the current object value, or `$` to denote the top-level element. For example, use `@.key_name` to refer to a nested value and `$.top_level_key_name` to refer to a top-level value.\n\nFrom version v2.4.2 onward, you can use the comparison operator `=~` to match a path of a string value on the left side against a regular expression pattern on the right side. For more information, see the [supported regular expression syntax docs](https://docs.rs/regex/latest/regex/#syntax).\n\nNon-string values do not match. A match can only occur when the left side is a path of a string value and the right side is either a hard-coded string, or a path of a string value. See [examples](#json-filter-examples) below.\n\nThe regex match is partial, meaning a regex pattern like `\"foo\"` matches a string such as `\"barefoots\"`.\nTo make the match exact, use the regex pattern `\"^foo$\"`.\n\nOther JSONPath engines may use regex patterns between slashes (for example, `/foo/`),\nand their match is exact. They can perform partial matches using a regex pattern such\nas `/.*foo.*/`."
    },
    {
      "id": "filter-examples",
      "title": "Filter examples",
      "role": "content",
      "text": "In the following example, the filter only returns mountain bikes with a price less than 3000 and\na weight less than 10:\n\nFilter expressions: Use ?() with comparison and logical operators to select elements matching specific conditions when you need to query based on multiple criteria\n\n**Difficulty:** Advanced\n\n**Builds upon:** get_models\n\n**Commands:** JSON.GET\n\n**Complexity:**\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nThis example filters the inventory for the model names of bikes made from alloy:\n\nEquality filters: Use == operator in filter expressions to select elements with specific field values when you need to find items matching exact criteria\n\n**Difficulty:** Advanced\n\n**Builds upon:** filter1\n\n**Commands:** JSON.GET\n\n**Complexity:**\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nThis example, valid from version v2.4.2 onwards, filters only bikes whose material begins with\n\"al-\" using regex match. Note that this match is case-insensitive because of the prefix `(?i)` in\nthe regular expression pattern `\"(?i)al\"`:\n\nRegex filters: Use =~ operator with regular expressions in filter expressions to match patterns in string values when you need flexible pattern-based filtering\n\n**Difficulty:** Advanced\n\n**Builds upon:** filter2\n\n**Commands:** JSON.GET\n\n**Complexity:**\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nYou can also specify a regex pattern using a property from the JSON object itself.\nFor example, we can add a string property named `regex_pat` to each mountain bike,\nwith the value `\"(?i)al\"` to match the material, as in the previous example. We\ncan then match `regex_pat` against the bike's material: \n\nDynamic regex filters: Use regex patterns stored in JSON properties to filter elements when you need to apply patterns defined within the document itself\n\n**Difficulty:** Advanced\n\n**Builds upon:** filter3\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nBeginning with Redis 8.10, the JSONPath filter syntax supports the following operators.\n\n#### Negation `!`\n\nThe `!` operator negates a filter condition. It binds more tightly than the logical `&&` and `||` operators, so use parentheses to negate a compound condition. A double negation (`!!`) is equivalent to an existence test.\n\nFilter negation: Use the ! operator to invert a filter condition when you need to select elements that do not match\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### Comparing array and object literals\n\nThe `==` and `!=` operators can compare any JSON literal, including array and object literals, on either side of the operator. Comparison is by structural (deep) equality. A comparison between values of different types is always false.\n\nLiteral comparison: Use == and != to compare array and object literals by structural equality when you need to match a whole nested value\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### Arithmetic operators\n\nThe binary operators `+`, `-`, `*`, `/`, and `%` and the unary operators `-` and `+` operate on numbers. Precedence, from highest to lowest, is: unary `-`/`+`, then `*`/`/`/`%`, then `+`/`-`. Use parentheses to override precedence. Division always produces a floating-point result. Division or modulo by zero produces *Nothing*, so no element matches.\n\nRemember that arithmetic operators must be surrounded by spaces (see [Evaluation semantics](#evaluation-semantics)).\n\nArithmetic in filters: Use +, -, *, / and % inside a filter condition when you need to compute a value before comparing it\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### Membership: `in` and `nin`\n\n`value in array` matches when `value` is a member of `array`; `value nin array` is its strict negation. The right-hand side can be an array literal or a path to an array. Membership uses the same structural comparison and number coercion as `==`. If the right-hand side is not an array, `in` is false (so `nin` is true).\n\nMembership filters: Use in and nin to test whether a value is a member of an array when you need set-style matching\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### Set relations: `subsetof`, `anyof`, and `noneof`\n\nThese operators compare two arrays (each side can be an array literal or a path to an array):\n\n- `subsetof` matches when every element of the left array is a member of the right array. An empty array is a subset of any array.\n- `anyof` matches when the two arrays have a non-empty intersection. An empty array never matches.\n- `noneof` matches when the two arrays have an empty intersection. An empty array always matches.\n\nSet relation filters: Use subsetof, anyof, and noneof to compare two arrays when you need to match based on their overlap\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `size` (`sizeof`) and `empty`\n\n`left sizeof n` matches when the size of `left` equals the integer `n`, where size is the number of characters in a string, the number of elements in an array, or the number of members in an object. A non-integer `n` is truncated toward zero; a non-numeric `n` never matches. `size` is an alias for `sizeof`.\n\n`left empty true` matches an empty string, array, or object; `left empty false` matches a non-empty one.\n\nSize and emptiness filters: Use sizeof and empty to filter by the size or emptiness of a string, array, or object\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### Get-keys operator `~`\n\nThe terminal `~` operator returns the member names of an object as a flat list of strings. Applied to the root (`$~`), it returns the top-level keys. Applied to a multiple-match receiver, it flattens the keys of every matched object. A non-object receiver contributes no keys.\n\nBecause `~` is terminal, expressions such as `$.obj~.x`, `$.obj~~`, and `$.obj.keys()~` are parse errors. For a composable alternative that can be chained with other functions, use the [`keys()`](#keys) function.\n\nGet-keys filter: Use the ~ operator to retrieve an object's member names as a list of strings\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nFunctions can appear inside filter expressions and, when they return a value, as top-level [projection expressions](#projection-expressions). Beginning with Redis 8.10, JSONPath supports the following functions.\n\n#### `length()`\n\nReturns the number of characters in a string, elements in an array, or members in an object. Any other type produces *Nothing*.\n\nLength function: Use length() to get the number of characters in a string, elements in an array, or members in an object\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `count()`\n\nReturns the number of nodes selected by a query. An absent path counts as `0`; a single node counts as `1`.\n\nCount function: Use count() to get the number of nodes selected by a query\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `value()`\n\nReturns the value of a query that selects exactly one node. A query that selects zero or more than one node produces *Nothing*.\n\nValue function: Use value() to get the value of a query that selects exactly one node\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `keys()`\n\nReturns the member names of an object as a list of strings, like the `~` operator. Unlike `~`, `keys()` is composable and can be chained with other functions.\n\nKeys function: Use keys() to get an object's member names as a composable, chainable list of strings\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `match()` and `search()`\n\nBoth test a string against a regular expression pattern ([RFC 9485](https://datatracker.ietf.org/doc/rfc9485/) I-Regexp). `match()` requires the whole string to match (anchored), while `search()` matches any substring (the same behavior as the `=~` operator). An invalid pattern produces no match.\n\nRegex functions: Use match() for an anchored (whole-string) regular expression match and search() for a partial match\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `concat()`\n\nConcatenates its string arguments into a single string. It requires at least one argument, and any non-string argument produces *Nothing*.\n\nConcat function: Use concat() to join string arguments into a single string for comparison in a filter\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `abs()`, `ceiling()`, and `floor()`\n\nOperate on a number: `abs()` returns the absolute value, `ceiling()` rounds up to the nearest integer, and `floor()` rounds down. An integer argument stays an integer and a floating-point argument stays a float. A result that overflows the signed 64-bit integer range produces *Nothing*.\n\nNumeric functions: Use abs(), ceiling(), and floor() to transform a number before comparing it in a filter\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `first()`, `last()`, and `index()`\n\n`first(array)` and `last(array)` return the first and last element of an array. `index(array, n)` returns the element at index `n`; a negative `n` counts from the end, a fractional `n` is truncated toward zero, and an out-of-range index produces *Nothing*.\n\nArray access functions: Use first(), last(), and index() to pick a single element out of an array before comparing it\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `min()`, `max()`, `avg()`, `sum()`, and `stddev()`\n\nThese aggregation functions operate on an array of numbers. `stddev()` returns the *population* standard deviation (dividing by N). The functions are strict: an array that contains any non-numeric element, or an empty array, produces *Nothing* — elements are never silently skipped.\n\nAggregation functions: Use sum(), avg(), min(), max(), or stddev() to reduce an array of numbers to a single value in a filter\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n#### `append()`\n\n`append(value, ...)` returns the matched array with the given value or values added after its elements. It is a read-only query-time projection and does not modify the stored document — to mutate an array in place, use the [`JSON.ARRAPPEND`](https://redis.io/docs/latest/commands/json.arrappend) command instead. A multiple-value argument is added as a single element (it is not spread), and a *Nothing* argument makes the whole result *Nothing*.\n\nAppend function: Use append() as a read-only, query-time projection that adds a value after an array's elements without modifying the stored document\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]"
    },
    {
      "id": "update-examples",
      "title": "Update examples",
      "role": "content",
      "text": "You can also use JSONPath queries when you want to update specific sections of a JSON document.\n\nFor example, you can pass a JSONPath to the [`JSON.SET`](https://redis.io/docs/latest/commands/json.set) command to update a specific field. This example changes the price of the first item in the headphones list:\n\nBulk updates: Use JSONPath with JSON.NUMINCRBY to update multiple numeric values across the document when you need to apply arithmetic operations to multiple fields\n\n**Difficulty:** Intermediate\n\n**Builds upon:** get_bikes\n\n**Commands:** JSON.GET, JSON.NUMINCRBY\n\n**Complexity:**\n- JSON.GET: O(N)\n- JSON.NUMINCRBY: O(1)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nYou can use filter expressions to update only JSON elements that match certain conditions. The following example sets the price of any bike to 1500 if its price is already less than 2000:\n\nConditional updates: Use filter expressions with JSON.SET to update only elements matching specific conditions when you need selective modifications\n\n**Difficulty:** Advanced\n\n**Builds upon:** filter1\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nJSONPath queries also work with other JSON commands that accept a path as an argument. For example, you can add a new color option for a set of headphones with [`JSON.ARRAPPEND`](https://redis.io/docs/latest/commands/json.arrappend):\n\nArray updates with filters: Use JSON.ARRAPPEND with filter expressions to add elements to arrays matching conditions when you need to modify collections selectively\n\n**Difficulty:** Advanced\n\n**Builds upon:** update_filters1\n\n**Commands:** JSON.ARRAPPEND, JSON.GET\n\n**Complexity:**\n- JSON.ARRAPPEND: O(1)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]"
    },
    {
      "id": "projection-expressions",
      "title": "Projection expressions",
      "role": "content",
      "text": "The top level of a JSONPath query can be an expression that *computes* a value — arithmetic, a function call, a get-keys operator, and so on — rather than only selecting nodes from the document. A query that is a plain path (for example, `$.a.b`, `$..x`, or even a fully parenthesized path such as `($.a)`) still selects nodes; anything else (for example, `$.a + 1`, `-$.a`, `$.arr.length()`, `length($.arr)`, `$.obj~`, or `$.obj.keys()`) is a projection.\n\nA projection that evaluates to *Nothing* produces an empty reply (`[]`).\n\nProjection expressions: Use arithmetic, a function call, or the length of a path as a top-level query that computes a value instead of only selecting nodes\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.SET, JSON.GET\n\n**Complexity:**\n- JSON.SET: O(M+N)\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\nWhen [`JSON.GET`](https://redis.io/docs/latest/commands/json.get) is given more than one path, projections and plain paths can be mixed, and each path becomes a key in the returned object. The order of keys in that object is not guaranteed.\n\nMulti-path queries: Pass more than one path to JSON.GET to have each path's result returned under its own key in a single reply\n\n**Difficulty:** Advanced\n\n**Commands:** JSON.GET\n\n**Complexity:**\n- JSON.GET: O(N)\n\n**Available in:** Redis CLI, C#, Go, Java (Asynchronous - Lettuce), Java (Reactive - Lettuce), Java (Synchronous - Jedis), JavaScript (Node.js), PHP, Python, Ruby, Rust (Asynchronous), Rust (Synchronous)\n\n##### Redis CLI\n\n[code example]\n\n##### C#\n\n[code example]\n\n##### Go\n\n[code example]\n\n##### Java (Asynchronous - Lettuce)\n\n[code example]\n\n##### Java (Reactive - Lettuce)\n\n[code example]\n\n##### Java (Synchronous - Jedis)\n\n[code example]\n\n##### JavaScript (Node.js)\n\n[code example]\n\n##### PHP\n\n[code example]\n\n##### Python\n\n[code example]\n\n##### Ruby\n\n[code example]\n\n##### Rust (Asynchronous)\n\n[code example]\n\n##### Rust (Synchronous)\n\n[code example]\n\n\n\n[`JSON.MGET`](https://redis.io/docs/latest/commands/json.mget) evaluates the projection independently for each key. A missing key, or a per-key evaluation error, yields a null reply for that key rather than failing the whole request."
    },
    {
      "id": "legacy-path-syntax",
      "title": "Legacy path syntax",
      "role": "content",
      "text": "RedisJSON v1 had the following path implementation. JSON v2 still supports this legacy path in addition to JSONPath.\n\nPaths always begin at the root of a Redis JSON value. The root is denoted by a period character (`.`). For paths that reference the root's children, it is optional to prefix the path with the root.\n\nRedis JSON supports both dot notation and bracket notation for object key access. The following paths refer to _headphones_, which is a child of _inventory_ under the root:\n\n*   `.inventory.headphones`\n*   `inventory[\"headphones\"]`\n*   `['inventory'][\"headphones\"]`\n\nTo access an array element, enclose its index within a pair of square brackets. The index is 0-based, with 0 being the first element of the array, 1 being the next element, and so on. You can use negative offsets to access elements starting from the end of the array. For example, -1 is the last element in the array, -2 is the second to last element, and so on."
    },
    {
      "id": "json-key-names-and-path-compatibility",
      "title": "JSON key names and path compatibility",
      "role": "content",
      "text": "By definition, a JSON key can be any valid JSON string. Paths, on the other hand, are traditionally based on JavaScript's (and Java's) variable naming conventions.\n\nAlthough JSON can store objects that contain arbitrary key names, you can only use a legacy path to access these keys if they conform to these naming syntax rules:\n\n1.  Names must begin with a letter, a dollar sign (`$`), or an underscore (`_`) character\n2.  Names can contain letters, digits, dollar signs, and underscores\n3.  Names are case-sensitive"
    },
    {
      "id": "time-complexity-of-path-evaluation",
      "title": "Time complexity of path evaluation",
      "role": "content",
      "text": "The time complexity of searching (navigating to) an element in the path is calculated from:\n\n1. Child level - every level along the path adds an additional search\n2. Key search - O(N)<sup>&#8224;</sup>, where N is the number of keys in the parent object\n3. Array search - O(1)\n\nThis means that the overall time complexity of searching a path is _O(N*M)_, where N is the depth and M is the number of parent object keys.\n\n<sup>&#8224;</sup> While this is acceptable for objects where N is small, access can be optimized for larger objects."
    }
  ],
  "examples": [
    {
      "id": "jsonpath-support-ex0",
      "language": "bash",
      "code": "JSON.GET store '$.inventory[\"mountain_bikes\"]'",
      "section_id": "jsonpath-support"
    },
    {
      "id": "jsonpath-examples-ex0",
      "language": "json",
      "code": "{\n    \"inventory\": {\n        \"mountain_bikes\": [\n            {\n                \"id\": \"bike:1\",\n                \"model\": \"Phoebe\",\n                \"description\": \"This is a mid-travel trail slayer that is a fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset gives plenty of gear range to tackle hills and there\\u2019s room for mudguards and a rack too.  This is the bike for the rider who wants trail manners with low fuss ownership.\",\n                \"price\": 1920,\n                \"specs\": {\"material\": \"carbon\", \"weight\": 13.1},\n                \"colors\": [\"black\", \"silver\"],\n            },\n... output truncated for AI-facing Markdown ...\n                \"description\": \"A real joy to ride, this bike got very high scores in last years Bike of the year report. The carefully crafted 50-34 tooth chainset and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb throttle. Put it all together and you get a bike that helps redefine what can be done for this price.\",\n                \"price\": 3941,\n                \"specs\": {\"material\": \"alloy\", \"weight\": 11.6},\n            },\n        ],\n    }\n}",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex1",
      "language": "plaintext",
      "code": "> JSON.SET bikes:inventory $ '{ \"inventory\": { \"mountain_bikes\": [ { \"id\": \"bike:1\", \"model\": \"Phoebe\", \"description\": \"This is a mid-travel trail slayer that is a fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset gives plenty of gear range to tackle hills and there\\'s room for mudguards and a rack too. This is the bike for the rider who wants trail manners with low fuss ownership.\", \"price\": 1920, \"specs\": {\"material\": \"carbon\", \"weight\": 13.1}, \"colors\": [\"black\", \"silver\"] }, { \"id\": \"bike:2\", \"model\": \"Quaoar\", \"description\": \"Redesigned for the 2020 model year, this bike impressed our testers and is the best all-around trail bike we\\'ve ever tested. The Shimano gear system effectively does away with an external cassette, so is super low maintenance in terms of wear and tear. All in all it\\'s an impressive package for the price, making it very competitive.\", \"price\": 2072, \"specs\": {\"material\": \"aluminium\", \"weight\": 7.9}, \"colors\": [\"black\", \"white\"] }, { \"id\": \"bike:3\", \"model\": \"Weywot\", \"description\": \"This bike gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes provide ample stopping ability. If you\\'re after a budget option, this is one of the best bikes you could get.\", \"price\": 3264, \"specs\": {\"material\": \"alloy\", \"weight\": 13.8} } ], \"commuter_bikes\": [ { \"id\": \"bike:4\", \"model\": \"Salacia\", \"description\": \"This bike is a great option for anyone who just wants a bike to get about on With a slick-shifting Claris gears from Shimano\\'s, this is a bike which doesn\\'t break the bank and delivers craved performance. It\\'s for the rider who wants both efficiency and capability.\", \"price\": 1475, \"specs\": {\"material\": \"aluminium\", \"weight\": 16.6}, \"colors\": [\"black\", \"silver\"] }, { \"id\": \"bike:5\", \"model\": \"Mimas\", \"description\": \"A real joy to ride, this bike got very high scores in last years Bike of the year report. The carefully crafted 50-34 tooth chainset and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb throttle. Put it all together and you get a bike that helps redefine what can be done for this price.\", \"price\": 3941, \"specs\": {\"material\": \"alloy\", \"weight\": 11.6} } ] }}'\n... output truncated for AI-facing Markdown ...\n> JSON.SET bikes:inventory $ '{ \"inventory\": { \"mountain_bikes\": [ { \"id\": \"bike:1\", \"model\": \"Phoebe\", \"description\": \"This is a mid-travel trail slayer that is a fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset gives plenty of gear range to tackle hills and there\\'s room for mudguards and a rack too. This is the bike for the rider who wants trail manners with low fuss ownership.\", \"price\": 1920, \"specs\": {\"material\": \"carbon\", \"weight\": 13.1}, \"colors\": [\"black\", \"silver\"] }, { \"id\": \"bike:2\", \"model\": \"Quaoar\", \"description\": \"Redesigned for the 2020 model year, this bike impressed our testers and is the best all-around trail bike we\\'ve ever tested. The Shimano gear system effectively does away with an external cassette, so is super low maintenance in terms of wear and tear. All in all it\\'s an impressive package for the price, making it very competitive.\", \"price\": 2072, \"specs\": {\"material\": \"aluminium\", \"weight\": 7.9}, \"colors\": [\"black\", \"white\"] }, { \"id\": \"bike:3\", \"model\": \"Weywot\", \"description\": \"This bike gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes provide ample stopping ability. If you\\'re after a budget option, this is one of the best bikes you could get.\", \"price\": 3264, \"specs\": {\"material\": \"alloy\", \"weight\": 13.8} } ], \"commuter_bikes\": [ { \"id\": \"bike:4\", \"model\": \"Salacia\", \"description\": \"This bike is a great option for anyone who just wants a bike to get about on With a slick-shifting Claris gears from Shimano\\'s, this is a bike which doesn\\'t break the bank and delivers craved performance. It\\'s for the rider who wants both efficiency and capability.\", \"price\": 1475, \"specs\": {\"material\": \"aluminium\", \"weight\": 16.6}, \"colors\": [\"black\", \"silver\"] }, { \"id\": \"bike:5\", \"model\": \"Mimas\", \"description\": \"A real joy to ride, this bike got very high scores in last years Bike of the year report. The carefully crafted 50-34 tooth chainset and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb throttle. Put it all together and you get a bike that helps redefine what can be done for this price.\", \"price\": 3941, \"specs\": {\"material\": \"alloy\", \"weight\": 11.6} } ] }}'",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex2",
      "language": "csharp",
      "code": "string inventoryJson = @\"\n{\n    \"\"inventory\"\": {\n        \"\"mountain_bikes\"\": [\n            {\n                \"\"id\"\": \"\"bike:1\"\",\n                \"\"model\"\": \"\"Phoebe\"\",\n                \"\"description\"\": \"\"This is a mid-travel trail slayer that is a fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset gives plenty of gear range to tackle hills and there\\u2019s room for mudguards and a rack too.  This is the bike for the rider who wants trail manners with low fuss ownership.\"\",\n                \"\"price\"\": 1920,\n                \"\"specs\"\": {\"\"material\"\": \"\"carbon\"\", \"\"weight\"\": 13.1},\n                \"\"colors\"\": [\"\"black\"\", \"\"silver\"\"]\n            },\n            {\n                \"\"id\"\": \"\"bike:2\"\",\n                \"\"model\"\": \"\"Quaoar\"\",\n                \"\"description\"\": \"\"Redesigned for the 2020 model year, this bike impressed our testers and is the best all-around trail bike we've ever tested. The Shimano gear system effectively does away with an external cassette, so is super low maintenance in terms of wear and tear. All in all it's an impressive package for the price, making it very competitive.\"\",\n                \"\"price\"\": 2072,\n                \"\"specs\"\": {\"\"material\"\": \"\"aluminium\"\", \"\"weight\"\": 7.9},\n                \"\"colors\"\": [\"\"black\"\", \"\"white\"\"]\n            },\n            {\n                \"\"id\"\": \"\"bike:3\"\",\n                \"\"model\"\": \"\"Weywot\"\",\n                \"\"description\"\": \"\"This bike gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes provide ample stopping ability. If you're after a budget option, this is one of the best bikes you could get.\"\",\n                \"\"price\"\": 3264,\n                \"\"specs\"\": {\"\"material\"\": \"\"alloy\"\", \"\"weight\"\": 13.8}\n            }\n        ],\n        \"\"commuter_bikes\"\": [\n            {\n                \"\"id\"\": \"\"bike:4\"\",\n                \"\"model\"\": \"\"Salacia\"\",\n                \"\"description\"\": \"\"This bike is a great option for anyone who just wants a bike to get about on With a slick-shifting Claris gears from Shimano\\u2019s, this is a bike which doesn\\u2019t break the bank and delivers craved performance.  It\\u2019s for the rider who wants both efficiency and capability.\"\",\n                \"\"price\"\": 1475,\n                \"\"specs\"\": {\"\"material\"\": \"\"aluminium\"\", \"\"weight\"\": 16.6},\n                \"\"colors\"\": [\"\"black\"\", \"\"silver\"\"]\n            },\n            {\n                \"\"id\"\": \"\"bike:5\"\",\n                \"\"model\"\": \"\"Mimas\"\",\n                \"\"description\"\": \"\"A real joy to ride, this bike got very high scores in last years Bike of the year report. The carefully crafted 50-34 tooth chainset and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb throttle. Put it all together and you get a bike that helps redefine what can be done for this price.\"\",\n                \"\"price\"\": 3941,\n                \"\"specs\"\": {\"\"material\"\": \"\"alloy\"\", \"\"weight\"\": 11.6}\n            }\n        ]\n    }\n}\";\n\n        bool res28 = db.JSON().Set(\"bikes:inventory\", \"$\", inventoryJson);\n        Console.WriteLine(res28);   // >>> True",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex3",
      "language": "go",
      "code": "var inventory_json = map[string]interface{}{\n\t\t\"inventory\": map[string]interface{}{\n\t\t\t\"mountain_bikes\": []interface{}{\n\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\"id\":    \"bike:1\",\n\t\t\t\t\t\"model\": \"Phoebe\",\n\t\t\t\t\t\"description\": \"This is a mid-travel trail slayer that is a fantastic \" +\n\t\t\t\t\t\t\"daily driver or one bike quiver. The Shimano Claris 8-speed groupset \" +\n\t\t\t\t\t\t\"gives plenty of gear range to tackle hills and there\\u2019s room for \" +\n\t\t\t\t\t\t\"mudguards and a rack too.  This is the bike for the rider who wants \" +\n\t\t\t\t\t\t\"trail manners with low fuss ownership.\",\n\t\t\t\t\t\"price\":  1920,\n\t\t\t\t\t\"specs\":  map[string]interface{}{\"material\": \"carbon\", \"weight\": 13.1},\n\t\t\t\t\t\"colors\": []interface{}{\"black\", \"silver\"},\n\t\t\t\t},\n\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\"id\":    \"bike:2\",\n\t\t\t\t\t\"model\": \"Quaoar\",\n\t\t\t\t\t\"description\": \"Redesigned for the 2020 model year, this bike \" +\n\t\t\t\t\t\t\"impressed our testers and is the best all-around trail bike we've \" +\n\t\t\t\t\t\t\"ever tested. The Shimano gear system effectively does away with an \" +\n\t\t\t\t\t\t\"external cassette, so is super low maintenance in terms of wear \" +\n\t\t\t\t\t\t\"and tear. All in all it's an impressive package for the price, \" +\n\t\t\t\t\t\t\"making it very competitive.\",\n\t\t\t\t\t\"price\":  2072,\n\t\t\t\t\t\"specs\":  map[string]interface{}{\"material\": \"aluminium\", \"weight\": 7.9},\n\t\t\t\t\t\"colors\": []interface{}{\"black\", \"white\"},\n\t\t\t\t},\n\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\"id\":    \"bike:3\",\n\t\t\t\t\t\"model\": \"Weywot\",\n\t\t\t\t\t\"description\": \"This bike gives kids aged six years and older \" +\n\t\t\t\t\t\t\"a durable and uberlight mountain bike for their first experience \" +\n\t\t\t\t\t\t\"on tracks and easy cruising through forests and fields. A set of \" +\n\t\t\t\t\t\t\"powerful Shimano hydraulic disc brakes provide ample stopping \" +\n\t\t\t\t\t\t\"ability. If you're after a budget option, this is one of the best \" +\n\t\t\t\t\t\t\"bikes you could get.\",\n\t\t\t\t\t\"price\": 3264,\n\t\t\t\t\t\"specs\": map[string]interface{}{\"material\": \"alloy\", \"weight\": 13.8},\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"commuter_bikes\": []interface{}{\n\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\"id\":    \"bike:4\",\n\t\t\t\t\t\"model\": \"Salacia\",\n\t\t\t\t\t\"description\": \"This bike is a great option for anyone who just \" +\n\t\t\t\t\t\t\"wants a bike to get about on With a slick-shifting Claris gears \" +\n\t\t\t\t\t\t\"from Shimano\\u2019s, this is a bike which doesn\\u2019t break the \" +\n\t\t\t\t\t\t\"bank and delivers craved performance.  It\\u2019s for the rider \" +\n\t\t\t\t\t\t\"who wants both efficiency and capability.\",\n\t\t\t\t\t\"price\":  1475,\n\t\t\t\t\t\"specs\":  map[string]interface{}{\"material\": \"aluminium\", \"weight\": 16.6},\n\t\t\t\t\t\"colors\": []interface{}{\"black\", \"silver\"},\n\t\t\t\t},\n\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\"id\":    \"bike:5\",\n\t\t\t\t\t\"model\": \"Mimas\",\n\t\t\t\t\t\"description\": \"A real joy to ride, this bike got very high \" +\n\t\t\t\t\t\t\"scores in last years Bike of the year report. The carefully \" +\n\t\t\t\t\t\t\"crafted 50-34 tooth chainset and 11-32 tooth cassette give an \" +\n\t\t\t\t\t\t\"easy-on-the-legs bottom gear for climbing, and the high-quality \" +\n\t\t\t\t\t\t\"Vittoria Zaffiro tires give balance and grip.It includes \" +\n\t\t\t\t\t\t\"a low-step frame , our memory foam seat, bump-resistant shocks and \" +\n\t\t\t\t\t\t\"conveniently placed thumb throttle. Put it all together and you \" +\n\t\t\t\t\t\t\"get a bike that helps redefine what can be done for this price.\",\n\t\t\t\t\t\"price\": 3941,\n\t\t\t\t\t\"specs\": map[string]interface{}{\"material\": \"alloy\", \"weight\": 11.6},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tres1, err := rdb.JSONSet(ctx, \"bikes:inventory\", \"$\", inventory_json).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex4",
      "language": "java",
      "code": "String inventory_json_str = \"{\" + \"    \\\"inventory\\\": {\" + \"        \\\"mountain_bikes\\\": [\" + \"            {\"\n                    + \"                \\\"id\\\": \\\"bike:1\\\",\" + \"                \\\"model\\\": \\\"Phoebe\\\",\"\n                    + \"                \\\"description\\\": \\\"This is a mid-travel trail slayer that is a \"\n                    + \"fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset \"\n                    + \"gives plenty of gear range to tackle hills and there\\u2019s room for mudguards \"\n                    + \"and a rack too.  This is the bike for the rider who wants trail manners with \" + \"low fuss ownership.\\\",\"\n                    + \"                \\\"price\\\": 1920,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"carbon\\\", \\\"weight\\\": 13.1},\"\n                    + \"                \\\"colors\\\": [\\\"black\\\", \\\"silver\\\"]\" + \"            },\" + \"            {\"\n                    + \"                \\\"id\\\": \\\"bike:2\\\",\" + \"                \\\"model\\\": \\\"Quaoar\\\",\"\n                    + \"                \\\"description\\\": \\\"Redesigned for the 2020 model year, this \"\n                    + \"bike impressed our testers and is the best all-around trail bike we've ever \"\n                    + \"tested. The Shimano gear system effectively does away with an external cassette, \"\n                    + \"so is super low maintenance in terms of wear and tear. All in all it's an \"\n                    + \"impressive package for the price, making it very competitive.\\\",\" + \"                \\\"price\\\": 2072,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"aluminium\\\", \\\"weight\\\": 7.9},\"\n                    + \"                \\\"colors\\\": [\\\"black\\\", \\\"white\\\"]\" + \"            },\" + \"            {\"\n                    + \"                \\\"id\\\": \\\"bike:3\\\",\" + \"                \\\"model\\\": \\\"Weywot\\\",\"\n                    + \"                \\\"description\\\": \\\"This bike gives kids aged six years and older \"\n                    + \"a durable and uberlight mountain bike for their first experience on tracks and easy \"\n                    + \"cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes \"\n                    + \"provide ample stopping ability. If you're after a budget option, this is one of the \"\n                    + \"best bikes you could get.\\\",\" + \"                \\\"price\\\": 3264,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"alloy\\\", \\\"weight\\\": 13.8}\" + \"            }\" + \"        ],\"\n                    + \"        \\\"commuter_bikes\\\": [\" + \"            {\" + \"                \\\"id\\\": \\\"bike:4\\\",\"\n                    + \"                \\\"model\\\": \\\"Salacia\\\",\"\n                    + \"                \\\"description\\\": \\\"This bike is a great option for anyone who just \"\n                    + \"wants a bike to get about on With a slick-shifting Claris gears from Shimano\\u2019s, \"\n                    + \"this is a bike which doesn\\u2019t break the bank and delivers craved performance.  \"\n                    + \"It\\u2019s for the rider who wants both efficiency and capability.\\\",\"\n                    + \"                \\\"price\\\": 1475,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"aluminium\\\", \\\"weight\\\": 16.6},\"\n                    + \"                \\\"colors\\\": [\\\"black\\\", \\\"silver\\\"]\" + \"            },\" + \"            {\"\n                    + \"                \\\"id\\\": \\\"bike:5\\\",\" + \"                \\\"model\\\": \\\"Mimas\\\",\"\n                    + \"                \\\"description\\\": \\\"A real joy to ride, this bike got very high scores \"\n                    + \"in last years Bike of the year report. The carefully crafted 50-34 tooth chainset \"\n                    + \"and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the \"\n                    + \"high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step \"\n                    + \"frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb \"\n                    + \"throttle. Put it all together and you get a bike that helps redefine what can be \"\n                    + \"done for this price.\\\",\" + \"                \\\"price\\\": 3941,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"alloy\\\", \\\"weight\\\": 11.6}\" + \"            }\" + \"        ]\"\n                    + \"    }\" + \"}\";\n\n            Charset charset = Charset.forName(\"UTF-8\");\n            ByteBuffer inventory_json = charset.encode(inventory_json_str);\n\n            CompletableFuture<Void> setBikes = asyncCommands\n                    .jsonSet(\"bikes:inventory\", JsonPath.ROOT_PATH, parser.loadJsonValue(inventory_json))\n                    .thenAccept(System.out::println) // >>> OK\n                    .toCompletableFuture();",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex5",
      "language": "java",
      "code": "String inventory_json_str = \"{\" + \"    \\\"inventory\\\": {\" + \"        \\\"mountain_bikes\\\": [\" + \"            {\"\n                    + \"                \\\"id\\\": \\\"bike:1\\\",\" + \"                \\\"model\\\": \\\"Phoebe\\\",\"\n                    + \"                \\\"description\\\": \\\"This is a mid-travel trail slayer that is a \"\n                    + \"fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset \"\n                    + \"gives plenty of gear range to tackle hills and there\\u2019s room for mudguards \"\n                    + \"and a rack too.  This is the bike for the rider who wants trail manners with \" + \"low fuss ownership.\\\",\"\n                    + \"                \\\"price\\\": 1920,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"carbon\\\", \\\"weight\\\": 13.1},\"\n                    + \"                \\\"colors\\\": [\\\"black\\\", \\\"silver\\\"]\" + \"            },\" + \"            {\"\n                    + \"                \\\"id\\\": \\\"bike:2\\\",\" + \"                \\\"model\\\": \\\"Quaoar\\\",\"\n                    + \"                \\\"description\\\": \\\"Redesigned for the 2020 model year, this \"\n                    + \"bike impressed our testers and is the best all-around trail bike we've ever \"\n                    + \"tested. The Shimano gear system effectively does away with an external cassette, \"\n                    + \"so is super low maintenance in terms of wear and tear. All in all it's an \"\n                    + \"impressive package for the price, making it very competitive.\\\",\" + \"                \\\"price\\\": 2072,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"aluminium\\\", \\\"weight\\\": 7.9},\"\n                    + \"                \\\"colors\\\": [\\\"black\\\", \\\"white\\\"]\" + \"            },\" + \"            {\"\n                    + \"                \\\"id\\\": \\\"bike:3\\\",\" + \"                \\\"model\\\": \\\"Weywot\\\",\"\n                    + \"                \\\"description\\\": \\\"This bike gives kids aged six years and older \"\n                    + \"a durable and uberlight mountain bike for their first experience on tracks and easy \"\n                    + \"cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes \"\n                    + \"provide ample stopping ability. If you're after a budget option, this is one of the \"\n                    + \"best bikes you could get.\\\",\" + \"                \\\"price\\\": 3264,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"alloy\\\", \\\"weight\\\": 13.8}\" + \"            }\" + \"        ],\"\n                    + \"        \\\"commuter_bikes\\\": [\" + \"            {\" + \"                \\\"id\\\": \\\"bike:4\\\",\"\n                    + \"                \\\"model\\\": \\\"Salacia\\\",\"\n                    + \"                \\\"description\\\": \\\"This bike is a great option for anyone who just \"\n                    + \"wants a bike to get about on With a slick-shifting Claris gears from Shimano\\u2019s, \"\n                    + \"this is a bike which doesn\\u2019t break the bank and delivers craved performance.  \"\n                    + \"It\\u2019s for the rider who wants both efficiency and capability.\\\",\"\n                    + \"                \\\"price\\\": 1475,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"aluminium\\\", \\\"weight\\\": 16.6},\"\n                    + \"                \\\"colors\\\": [\\\"black\\\", \\\"silver\\\"]\" + \"            },\" + \"            {\"\n                    + \"                \\\"id\\\": \\\"bike:5\\\",\" + \"                \\\"model\\\": \\\"Mimas\\\",\"\n                    + \"                \\\"description\\\": \\\"A real joy to ride, this bike got very high scores \"\n                    + \"in last years Bike of the year report. The carefully crafted 50-34 tooth chainset \"\n                    + \"and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the \"\n                    + \"high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step \"\n                    + \"frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb \"\n                    + \"throttle. Put it all together and you get a bike that helps redefine what can be \"\n                    + \"done for this price.\\\",\" + \"                \\\"price\\\": 3941,\"\n                    + \"                \\\"specs\\\": {\\\"material\\\": \\\"alloy\\\", \\\"weight\\\": 11.6}\" + \"            }\" + \"        ]\"\n                    + \"    }\" + \"}\";\n\n            Charset charset = Charset.forName(\"UTF-8\");\n            ByteBuffer inventory_json = charset.encode(inventory_json_str);\n\n            Mono<Void> setBikes = reactiveCommands\n                    .jsonSet(\"bikes:inventory\", JsonPath.ROOT_PATH, parser.loadJsonValue(inventory_json))\n                    .doOnNext(System.out::println) // >>> OK\n                    .then();",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex6",
      "language": "java",
      "code": "String inventory_json = \"{\"\n        + \"    \\\"inventory\\\": {\"\n        + \"        \\\"mountain_bikes\\\": [\"\n        + \"            {\"\n        + \"                \\\"id\\\": \\\"bike:1\\\",\"\n        + \"                \\\"model\\\": \\\"Phoebe\\\",\"\n        + \"                \\\"description\\\": \\\"This is a mid-travel trail slayer that is a \"\n        + \"fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset \"\n        + \"gives plenty of gear range to tackle hills and there\\u2019s room for mudguards \"\n        + \"and a rack too.  This is the bike for the rider who wants trail manners with \"\n        + \"low fuss ownership.\\\",\"\n        + \"                \\\"price\\\": 1920,\"\n        + \"                \\\"specs\\\": {\\\"material\\\": \\\"carbon\\\", \\\"weight\\\": 13.1},\"\n        + \"                \\\"colors\\\": [\\\"black\\\", \\\"silver\\\"]\"\n        + \"            },\"\n        + \"            {\"\n        + \"                \\\"id\\\": \\\"bike:2\\\",\"\n        + \"                \\\"model\\\": \\\"Quaoar\\\",\"\n        + \"                \\\"description\\\": \\\"Redesigned for the 2020 model year, this \"\n        + \"bike impressed our testers and is the best all-around trail bike we've ever \"\n        + \"tested. The Shimano gear system effectively does away with an external cassette, \"\n        + \"so is super low maintenance in terms of wear and tear. All in all it's an \"\n        + \"impressive package for the price, making it very competitive.\\\",\"\n        + \"                \\\"price\\\": 2072,\"\n        + \"                \\\"specs\\\": {\\\"material\\\": \\\"aluminium\\\", \\\"weight\\\": 7.9},\"\n        + \"                \\\"colors\\\": [\\\"black\\\", \\\"white\\\"]\"\n        + \"            },\"\n        + \"            {\"\n        + \"                \\\"id\\\": \\\"bike:3\\\",\"\n        + \"                \\\"model\\\": \\\"Weywot\\\",\"\n        + \"                \\\"description\\\": \\\"This bike gives kids aged six years and older \"\n        + \"a durable and uberlight mountain bike for their first experience on tracks and easy \"\n        + \"cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes \"\n        + \"provide ample stopping ability. If you're after a budget option, this is one of the \"\n        + \"best bikes you could get.\\\",\"\n        + \"                \\\"price\\\": 3264,\"\n        + \"                \\\"specs\\\": {\\\"material\\\": \\\"alloy\\\", \\\"weight\\\": 13.8}\"\n        + \"            }\"\n        + \"        ],\"\n        + \"        \\\"commuter_bikes\\\": [\"\n        + \"            {\"\n        + \"                \\\"id\\\": \\\"bike:4\\\",\"\n        + \"                \\\"model\\\": \\\"Salacia\\\",\"\n        + \"                \\\"description\\\": \\\"This bike is a great option for anyone who just \"\n        + \"wants a bike to get about on With a slick-shifting Claris gears from Shimano\\u2019s, \"\n        + \"this is a bike which doesn\\u2019t break the bank and delivers craved performance.  \"\n        + \"It\\u2019s for the rider who wants both efficiency and capability.\\\",\"\n        + \"                \\\"price\\\": 1475,\"\n        + \"                \\\"specs\\\": {\\\"material\\\": \\\"aluminium\\\", \\\"weight\\\": 16.6},\"\n        + \"                \\\"colors\\\": [\\\"black\\\", \\\"silver\\\"]\"\n        + \"            },\"\n        + \"            {\"\n        + \"                \\\"id\\\": \\\"bike:5\\\",\"\n        + \"                \\\"model\\\": \\\"Mimas\\\",\"\n        + \"                \\\"description\\\": \\\"A real joy to ride, this bike got very high scores \"\n        + \"in last years Bike of the year report. The carefully crafted 50-34 tooth chainset \"\n        + \"and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the \"\n        + \"high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step \"\n        + \"frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb \"\n        + \"throttle. Put it all together and you get a bike that helps redefine what can be \"\n        + \"done for this price.\\\",\"\n        + \"                \\\"price\\\": 3941,\"\n        + \"                \\\"specs\\\": {\\\"material\\\": \\\"alloy\\\", \\\"weight\\\": 11.6}\"\n        + \"            }\"\n        + \"        ]\"\n        + \"    }\"\n        + \"}\";\n\n        String res28 = jedis.jsonSet(\"bikes:inventory\", new Path2(\"$\"), inventory_json);\n        System.out.println(res28);  // >>> OK",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex7",
      "language": "javascript",
      "code": "const inventoryJSON = {\n  \"inventory\": {\n    \"mountain_bikes\": [{\n        \"id\": \"bike:1\",\n        \"model\": \"Phoebe\",\n        \"description\": \"This is a mid-travel trail slayer that is a fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset gives plenty of gear range to tackle hills and there\\u2019s room for mudguards and a rack too.  This is the bike for the rider who wants trail manners with low fuss ownership.\",\n        \"price\": 1920,\n        \"specs\": {\n          \"material\": \"carbon\",\n          \"weight\": 13.1\n        },\n        \"colors\": [\"black\", \"silver\"],\n      },\n      {\n        \"id\": \"bike:2\",\n        \"model\": \"Quaoar\",\n        \"description\": \"Redesigned for the 2020 model year, this bike impressed our testers and is the best all-around trail bike we've ever tested. The Shimano gear system effectively does away with an external cassette, so is super low maintenance in terms of wear and teaawait client. All in all it's an impressive package for the price, making it very competitive.\",\n        \"price\": 2072,\n        \"specs\": {\n          \"material\": \"aluminium\",\n          \"weight\": 7.9\n        },\n        \"colors\": [\"black\", \"white\"],\n      },\n      {\n        \"id\": \"bike:3\",\n        \"model\": \"Weywot\",\n        \"description\": \"This bike gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes provide ample stopping ability. If you're after a budget option, this is one of the best bikes you could get.\",\n        \"price\": 3264,\n        \"specs\": {\n          \"material\": \"alloy\",\n          \"weight\": 13.8\n        },\n      },\n    ],\n    \"commuter_bikes\": [{\n        \"id\": \"bike:4\",\n        \"model\": \"Salacia\",\n        \"description\": \"This bike is a great option for anyone who just wants a bike to get about on With a slick-shifting Claris gears from Shimano\\u2019s, this is a bike which doesn\\u2019t break the bank and delivers craved performance.  It\\u2019s for the rider who wants both efficiency and capability.\",\n        \"price\": 1475,\n        \"specs\": {\n          \"material\": \"aluminium\",\n          \"weight\": 16.6\n        },\n        \"colors\": [\"black\", \"silver\"],\n      },\n      {\n        \"id\": \"bike:5\",\n        \"model\": \"Mimas\",\n        \"description\": \"A real joy to ride, this bike got very high scores in last years Bike of the year report. The carefully crafted 50-34 tooth chainset and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb throttle. Put it all together and you get a bike that helps redefine what can be done for this price.\",\n        \"price\": 3941,\n        \"specs\": {\n          \"material\": \"alloy\",\n          \"weight\": 11.6\n        },\n      },\n    ],\n  }\n};\n\nconst res28 = await client.json.set(\"bikes:inventory\", \"$\", inventoryJSON);\nconsole.log(res28); //  OK",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex8",
      "language": "php",
      "code": "$inventory = [\n            'inventory' => [\n                'mountain_bikes' => [\n                    [\n                        'id' => 'bike:1',\n                        'model' => 'Phoebe',\n                        'description' => 'This is a mid-travel trail slayer that is a fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset gives plenty of gear range to tackle hills and there’s room for mudguards and a rack too.  This is the bike for the rider who wants trail manners with low fuss ownership.',\n                        'price' => 1920,\n                        'specs' => ['material' => 'carbon', 'weight' => 13.1],\n                        'colors' => ['black', 'silver'],\n                    ],\n                    [\n                        'id' => 'bike:2',\n                        'model' => 'Quaoar',\n                        'description' => \"Redesigned for the 2020 model year, this bike impressed our testers and is the best all-around trail bike we've ever tested. The Shimano gear system effectively does away with an external cassette, so is super low maintenance in terms of wear and tear. All in all it's an impressive package for the price, making it very competitive.\",\n                        'price' => 2072,\n                        'specs' => ['material' => 'aluminium', 'weight' => 7.9],\n                        'colors' => ['black', 'white'],\n                    ],\n                    [\n                        'id' => 'bike:3',\n                        'model' => 'Weywot',\n                        'description' => 'This bike gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes provide ample stopping ability. If you\\'re after a budget option, this is one of the best bikes you could get.',\n                        'price' => 3264,\n                        'specs' => ['material' => 'alloy', 'weight' => 13.8],\n                    ],\n                ],\n                'commuter_bikes' => [\n                    [\n                        'id' => 'bike:4',\n                        'model' => 'Salacia',\n                        'description' => 'This bike is a great option for anyone who just wants a bike to get about on With a slick-shifting Claris gears from Shimano’s, this is a bike which doesn’t break the bank and delivers craved performance.  It’s for the rider who wants both efficiency and capability.',\n                        'price' => 1475,\n                        'specs' => ['material' => 'aluminium', 'weight' => 16.6],\n                        'colors' => ['black', 'silver'],\n                    ],\n                    [\n                        'id' => 'bike:5',\n                        'model' => 'Mimas',\n                        'description' => 'A real joy to ride, this bike got very high scores in last years Bike of the year report. The carefully crafted 50-34 tooth chainset and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb throttle. Put it all together and you get a bike that helps redefine what can be done for this price.',\n                        'price' => 3941,\n                        'specs' => ['material' => 'alloy', 'weight' => 11.6],\n                    ],\n                ],\n            ],\n        ];\n        $res1b = $r->jsonset('bikes:inventory', '$', json_encode($inventory, JSON_THROW_ON_ERROR));\n        echo $res1b . PHP_EOL;\n        // >>> OK",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex9",
      "language": "python",
      "code": "inventory_json = {\n    \"inventory\": {\n        \"mountain_bikes\": [\n            {\n                \"id\": \"bike:1\",\n                \"model\": \"Phoebe\",\n                \"description\": \"This is a mid-travel trail slayer that is a fantastic \"\n                \"daily driver or one bike quiver. The Shimano Claris 8-speed groupset \"\n                \"gives plenty of gear range to tackle hills and there\\u2019s room for \"\n                \"mudguards and a rack too.  This is the bike for the rider who wants \"\n                \"trail manners with low fuss ownership.\",\n                \"price\": 1920,\n                \"specs\": {\"material\": \"carbon\", \"weight\": 13.1},\n                \"colors\": [\"black\", \"silver\"],\n            },\n            {\n                \"id\": \"bike:2\",\n                \"model\": \"Quaoar\",\n                \"description\": \"Redesigned for the 2020 model year, this bike \"\n                \"impressed our testers and is the best all-around trail bike we've \"\n                \"ever tested. The Shimano gear system effectively does away with an \"\n                \"external cassette, so is super low maintenance in terms of wear \"\n                \"and tear. All in all it's an impressive package for the price, \"\n                \"making it very competitive.\",\n                \"price\": 2072,\n                \"specs\": {\"material\": \"aluminium\", \"weight\": 7.9},\n                \"colors\": [\"black\", \"white\"],\n            },\n            {\n                \"id\": \"bike:3\",\n                \"model\": \"Weywot\",\n                \"description\": \"This bike gives kids aged six years and older \"\n                \"a durable and uberlight mountain bike for their first experience \"\n                \"on tracks and easy cruising through forests and fields. A set of \"\n                \"powerful Shimano hydraulic disc brakes provide ample stopping \"\n                \"ability. If you're after a budget option, this is one of the best \"\n                \"bikes you could get.\",\n                \"price\": 3264,\n                \"specs\": {\"material\": \"alloy\", \"weight\": 13.8},\n            },\n        ],\n        \"commuter_bikes\": [\n            {\n                \"id\": \"bike:4\",\n                \"model\": \"Salacia\",\n                \"description\": \"This bike is a great option for anyone who just \"\n                \"wants a bike to get about on With a slick-shifting Claris gears \"\n                \"from Shimano\\u2019s, this is a bike which doesn\\u2019t break the \"\n                \"bank and delivers craved performance.  It\\u2019s for the rider \"\n                \"who wants both efficiency and capability.\",\n                \"price\": 1475,\n                \"specs\": {\"material\": \"aluminium\", \"weight\": 16.6},\n                \"colors\": [\"black\", \"silver\"],\n            },\n            {\n                \"id\": \"bike:5\",\n                \"model\": \"Mimas\",\n                \"description\": \"A real joy to ride, this bike got very high \"\n                \"scores in last years Bike of the year report. The carefully \"\n                \"crafted 50-34 tooth chainset and 11-32 tooth cassette give an \"\n                \"easy-on-the-legs bottom gear for climbing, and the high-quality \"\n                \"Vittoria Zaffiro tires give balance and grip.It includes \"\n                \"a low-step frame , our memory foam seat, bump-resistant shocks and \"\n                \"conveniently placed thumb throttle. Put it all together and you \"\n                \"get a bike that helps redefine what can be done for this price.\",\n                \"price\": 3941,\n                \"specs\": {\"material\": \"alloy\", \"weight\": 11.6},\n            },\n        ],\n    }\n}\n\nres1 = r.json().set(\"bikes:inventory\", \"$\", inventory_json)\nprint(res1)  # >>> True",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex10",
      "language": "ruby",
      "code": "inventory_json = {\n  'inventory' => {\n    'mountain_bikes' => [\n      {\n        'id' => 'bike:1',\n        'model' => 'Phoebe',\n        'description' => 'This is a mid-travel trail slayer that is a fantastic ' \\\n          'daily driver or one bike quiver. The Shimano Claris 8-speed groupset ' \\\n          'gives plenty of gear range to tackle hills and there’s room for ' \\\n          'mudguards and a rack too.  This is the bike for the rider who wants ' \\\n          'trail manners with low fuss ownership.',\n        'price' => 1920,\n        'specs' => { 'material' => 'carbon', 'weight' => 13.1 },\n        'colors' => %w[black silver]\n      },\n      {\n        'id' => 'bike:2',\n        'model' => 'Quaoar',\n        'description' => 'Redesigned for the 2020 model year, this bike ' \\\n          \"impressed our testers and is the best all-around trail bike we've \" \\\n          'ever tested. The Shimano gear system effectively does away with an ' \\\n          'external cassette, so is super low maintenance in terms of wear ' \\\n          \"and tear. All in all it's an impressive package for the price, \" \\\n          'making it very competitive.',\n        'price' => 2072,\n        'specs' => { 'material' => 'aluminium', 'weight' => 7.9 },\n        'colors' => %w[black white]\n      },\n      {\n        'id' => 'bike:3',\n        'model' => 'Weywot',\n        'description' => 'This bike gives kids aged six years and older ' \\\n          'a durable and uberlight mountain bike for their first experience ' \\\n          'on tracks and easy cruising through forests and fields. A set of ' \\\n          'powerful Shimano hydraulic disc brakes provide ample stopping ' \\\n          \"ability. If you're after a budget option, this is one of the best \" \\\n          'bikes you could get.',\n        'price' => 3264,\n        'specs' => { 'material' => 'alloy', 'weight' => 13.8 }\n      }\n    ],\n    'commuter_bikes' => [\n      {\n        'id' => 'bike:4',\n        'model' => 'Salacia',\n        'description' => 'This bike is a great option for anyone who just ' \\\n          'wants a bike to get about on With a slick-shifting Claris gears ' \\\n          'from Shimano’s, this is a bike which doesn’t break the ' \\\n          \"bank and delivers craved performance.  It's for the rider \" \\\n          'who wants both efficiency and capability.',\n        'price' => 1475,\n        'specs' => { 'material' => 'aluminium', 'weight' => 16.6 },\n        'colors' => %w[black silver]\n      },\n      {\n        'id' => 'bike:5',\n        'model' => 'Mimas',\n        'description' => 'A real joy to ride, this bike got very high ' \\\n          'scores in last years Bike of the year report. The carefully ' \\\n          'crafted 50-34 tooth chainset and 11-32 tooth cassette give an ' \\\n          'easy-on-the-legs bottom gear for climbing, and the high-quality ' \\\n          'Vittoria Zaffiro tires give balance and grip.It includes ' \\\n          'a low-step frame , our memory foam seat, bump-resistant shocks and ' \\\n          'conveniently placed thumb throttle. Put it all together and you ' \\\n          'get a bike that helps redefine what can be done for this price.',\n        'price' => 3941,\n        'specs' => { 'material' => 'alloy', 'weight' => 11.6 }\n      }\n    ]\n  }\n}\n\nres1 = r.json_set('bikes:inventory', '$', inventory_json)\nputs res1 # >>> OK",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex11",
      "language": "rust",
      "code": "let res29: bool = r\n            .json_set(\"bikes:inventory\", \"$\", &inventory_json())\n            .await\n            .expect(\"Failed to run JSON.SET\");\n        print_set_result(res29); // >>> OK",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "jsonpath-examples-ex12",
      "language": "rust",
      "code": "let res29: bool = r\n            .json_set(\"bikes:inventory\", \"$\", &inventory_json())\n            .expect(\"Failed to run JSON.SET\");\n        print_set_result(res29); // >>> OK",
      "section_id": "jsonpath-examples"
    },
    {
      "id": "access-examples-ex0",
      "language": "plaintext",
      "code": "> JSON.GET bikes:inventory $.inventory.*\n\"[[{\\\"id\\\":\\\"bike:1\\\",\\\"model\\\":\\\"Phoebe\\\",\\\"description\\\":\\\"This is a mid-travel trail slayer that is a fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset gives plenty of gear range to tackle hills and there's room for mudguards and a rack too. This is the bike for the rider who wants trail manners with low fuss ownership.\\\",\\\"price\\\":1920,\\\"specs\\\":{\\\"material\\\":\\\"carbon\\\",\\\"weight\\\":13.1},\\\"colors\\\":[\\\"black\\\",\\\"silver\\\"]},{\\\"id\\\":\\\"bike:2\\\",\\\"model\\\":\\\"Quaoar\\\",\\\"description\\\":\\\"Redesigned for the 2020 model year, this bike impressed our testers and is the best all-around trail bike we've ever tested. The Shimano gear system effectively does away with an external cassette, so is super low maintenance in terms of wear and tear. All in all it's an impressive package for the price, making it very competitive.\\\",\\\"price\\\":2072,\\\"specs\\\":{\\\"material\\\":\\\"aluminium\\\",\\\"weight\\\":7.9},\\\"colors\\\":[\\\"black\\\",\\\"white\\\"]},{\\\"id\\\":\\\"bike:3\\\",\\\"model\\\":\\\"Weywot\\\",\\\"description\\\":\\\"This bike gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes provide ample stopping ability. If you're after a budget option, this is one of the best bikes you could get.\\\",\\\"price\\\":3264,\\\"specs\\\":{\\\"material\\\":\\\"alloy\\\",\\\"weight\\\":13.8}}],[{\\\"id\\\":\\\"bike:4\\\",\\\"model\\\":\\\"Salacia\\\",\\\"description\\\":\\\"This bike is a great option for anyone who just wants a bike to get about on With a slick-shifting Claris gears from Shimano's, this is a bike which doesn't break the bank and delivers craved performance. It's for the rider who wants both efficiency and capability.\\\",\\\"price\\\":1475,\\\"specs\\\":{\\\"material\\\":\\\"aluminium\\\",\\\"weight\\\":16.6},\\\"colors\\\":[\\\"black\\\",\\\"silver\\\"]},{\\\"id\\\":\\\"bike:5\\\",\\\"model\\\":\\\"Mimas\\\",\\\"description\\\":\\\"A real joy to ride, this bike got very high scores in last years Bike of the year report. The carefully crafted 50-34 tooth chainset and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb throttle. Put it all together and you get a bike that helps redefine what can be done for this price.\\\",\\\"price\\\":3941,\\\"specs\\\":{\\\"material\\\":\\\"alloy\\\",\\\"weight\\\":11.6}}]]\"",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex1",
      "language": "csharp",
      "code": "RedisResult res29 = db.JSON().Get(\"bikes:inventory\", path: \"$.inventory.*\");\n        Console.WriteLine(res29);   // >>> {[[{\"id\":\"bike:1\",\"model\":\"Phoebe\", ...",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex2",
      "language": "go",
      "code": "res2, err := rdb.JSONGetWithArgs(ctx, \"bikes:inventory\",\n\t\t&redis.JSONGetArgs{Indent: \"  \", Newline: \"\\n\", Space: \" \"},\n\t\t\"$.inventory.*\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2)\n\t// >>>\n\t// [\n\t//   [\n\t//     {\n\t//       \"colors\": [\n\t//         \"black\",\n\t//         \"silver\"\n\t// ...",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex3",
      "language": "java",
      "code": "CompletableFuture<Void> getBikes = asyncCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$.inventory.*\"))\n                    .thenAccept(System.out::println)\n                    // >>> [[[{\"id\":\"bike:1\",\"model\":\"Phoebe\",...\n                    .toCompletableFuture();",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex4",
      "language": "java",
      "code": "Mono<Void> getBikes = reactiveCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$.inventory.*\")).collectList()\n                    .doOnNext(System.out::println) // >>> [[[{\"id\":\"bike:1\",\"model\":\"Phoebe\",...\n                    .then();",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex5",
      "language": "java",
      "code": "Object res29 = jedis.jsonGet(\"bikes:inventory\", new Path2(\"$.inventory.*\"));\n        System.out.println(res29);\n        // >>> [[{\"specs\":{\"material\":\"carbon\",\"weight\":13.1},\"price\":1920, ...",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex6",
      "language": "javascript",
      "code": "const res29 = await client.json.get(\"bikes:inventory\", {\n  path: \"$.inventory.*\"\n});\nconsole.log(res29);\n/*\n[\n  [\n    {\n      id: 'bike:1',\n      model: 'Phoebe',\n      description: 'This is a mid-travel trail slayer that is a fantastic daily driver or one bike quiver. The Shimano Claris 8-speed groupset gives plenty of gear range to tackle hills and there’s room for mudguards and a rack too.  This is the bike for the rider who wants trail manners with low fuss ownership.',\n      price: 1920,\n      specs: [Object],\n      colors: [Array]\n    },\n    {\n      id: 'bike:2',\n      model: 'Quaoar',\n      description: \"Redesigned for the 2020 model year, this bike impressed our testers and is the best all-around trail bike we've ever tested. The Shimano gear system effectively does away with an external cassette, so is super low maintenance in terms of wear and teaawait client. All in all it's an impressive package for the price, making it very competitive.\",\n      price: 2072,\n      specs: [Object],\n      colors: [Array]\n    },\n    {\n      id: 'bike:3',\n      model: 'Weywot',\n      description: \"This bike gives kids aged six years and older a durable and uberlight mountain bike for their first experience on tracks and easy cruising through forests and fields. A set of powerful Shimano hydraulic disc brakes provide ample stopping ability. If you're after a budget option, this is one of the best bikes you could get.\",\n      price: 3264,\n      specs: [Object]\n    }\n  ],\n  [\n    {\n      id: 'bike:4',\n      model: 'Salacia',\n      description: 'This bike is a great option for anyone who just wants a bike to get about on With a slick-shifting Claris gears from Shimano’s, this is a bike which doesn’t break the bank and delivers craved performance.  It’s for the rider who wants both efficiency and capability.',\n      price: 1475,\n      specs: [Object],\n      colors: [Array]\n    },\n    {\n      id: 'bike:5',\n      model: 'Mimas',\n      description: 'A real joy to ride, this bike got very high scores in last years Bike of the year report. The carefully crafted 50-34 tooth chainset and 11-32 tooth cassette give an easy-on-the-legs bottom gear for climbing, and the high-quality Vittoria Zaffiro tires give balance and grip.It includes a low-step frame , our memory foam seat, bump-resistant shocks and conveniently placed thumb throttle. Put it all together and you get a bike that helps redefine what can be done for this price.',\n      price: 3941,\n      specs: [Object]\n    }\n  ]\n]\n*/",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex7",
      "language": "php",
      "code": "$res2b = $r->jsonget('bikes:inventory', '', '', '', '$.inventory.*');\n        echo $res2b . PHP_EOL;\n        // >>> [{'id': 'bike:1', 'model': 'Phoebe',",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex8",
      "language": "python",
      "code": "res2 = r.json().get(\"bikes:inventory\", \"$.inventory.*\")\nprint(res2)\n# >>>    [[{'id': 'bike:1', 'model': 'Phoebe',\n# >>>       'description': 'This is a mid-travel trail slayer...",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex9",
      "language": "ruby",
      "code": "res2 = r.json_get('bikes:inventory', '$.inventory.*')\np res2\n# >>> [[{\"id\"=>\"bike:1\", \"model\"=>\"Phoebe\",\n# >>>    \"description\"=>\"This is a mid-travel trail slayer...",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex10",
      "language": "rust",
      "code": "let res30: String = r\n            .json_get(\"bikes:inventory\", \"$.inventory.*\")\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res30}\");\n        // >>> [[{\"id\":\"bike:1\",\"model\":\"Phoebe\",\"description\":\"This is a mid-travel trail slayer...",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex11",
      "language": "rust",
      "code": "let res30: String = r\n            .json_get(\"bikes:inventory\", \"$.inventory.*\")\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res30}\");\n        // >>> [[{\"id\":\"bike:1\",\"model\":\"Phoebe\",\"description\":\"This is a mid-travel trail slayer...",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex12",
      "language": "plaintext",
      "code": "> JSON.GET bikes:inventory $.inventory.mountain_bikes[*].model\n\"[\\\"Phoebe\\\",\\\"Quaoar\\\",\\\"Weywot\\\"]\"\n> JSON.GET bikes:inventory '$.inventory[\"mountain_bikes\"][*].model'\n\"[\\\"Phoebe\\\",\\\"Quaoar\\\",\\\"Weywot\\\"]\"\n> JSON.GET bikes:inventory '$..mountain_bikes[*].model'\n\"[\\\"Phoebe\\\",\\\"Quaoar\\\",\\\"Weywot\\\"]\"",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex13",
      "language": "csharp",
      "code": "RedisResult res30 = db.JSON().Get(\"bikes:inventory\", path: \"$.inventory.mountain_bikes[*].model\");\n        Console.WriteLine(res30);   // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]\n\n        RedisResult res31 = db.JSON().Get(\"bikes:inventory\", path: \"$.inventory[\\\"mountain_bikes\\\"][*].model\");\n        Console.WriteLine(res31);   // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]\n\n        RedisResult res32 = db.JSON().Get(\"bikes:inventory\", path: \"$..mountain_bikes[*].model\");\n        Console.WriteLine(res32);   // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex14",
      "language": "go",
      "code": "res3, err := rdb.JSONGet(ctx, \"bikes:inventory\",\n\t\t\"$.inventory.mountain_bikes[*].model\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3)\n\t// >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]\n\n\tres4, err := rdb.JSONGet(ctx,\n\t\t\"bikes:inventory\", \"$.inventory[\\\"mountain_bikes\\\"][*].model\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4)\n\t// >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]\n\n\tres5, err := rdb.JSONGet(ctx,\n\t\t\"bikes:inventory\", \"$..mountain_bikes[*].model\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res5)\n\t// >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex15",
      "language": "java",
      "code": "CompletableFuture<Void> getMtnBikes = asyncCommands\n                    .jsonGet(\"bikes:inventory\", JsonPath.of(\"$.inventory.mountain_bikes[*].model\")).thenCompose(res19 -> {\n                        System.out.println(res19); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n                        return asyncCommands.jsonGet(\"bikes:inventory\",\n                                JsonPath.of(\"$.inventory[\\\"mountain_bikes\\\"][*].model\"));\n                    }).thenCompose(res20 -> {\n                        System.out.println(res20); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n                        return asyncCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..mountain_bikes[*].model\"));\n                    })\n                    .thenAccept(System.out::println)\n                    // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n                    .toCompletableFuture();",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex16",
      "language": "java",
      "code": "Mono<Void> getMtnBikes = reactiveCommands\n                    .jsonGet(\"bikes:inventory\", JsonPath.of(\"$.inventory.mountain_bikes[*].model\")).collectList()\n                    .doOnNext(res19 -> {\n                        System.out.println(res19); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n                    })\n                    .flatMap(res19 -> reactiveCommands\n                            .jsonGet(\"bikes:inventory\", JsonPath.of(\"$.inventory[\\\"mountain_bikes\\\"][*].model\")).collectList())\n                    .doOnNext(res20 -> {\n                        System.out.println(res20); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n                    })\n                    .flatMap(res20 -> reactiveCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..mountain_bikes[*].model\"))\n                            .collectList())\n                    .doOnNext(System.out::println) // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n                    .then();",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex17",
      "language": "java",
      "code": "Object res30 = jedis.jsonGet(\n            \"bikes:inventory\", new Path2(\"$.inventory.mountain_bikes[*].model\")\n        );\n        System.out.println(res30);  // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]\n\n        Object res31 = jedis.jsonGet(\n            \"bikes:inventory\", new Path2(\"$.inventory[\\\"mountain_bikes\\\"][*].model\")\n        );\n        System.out.println(res31);  // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]\n\n        Object res32 = jedis.jsonGet(\n            \"bikes:inventory\", new Path2(\"$..mountain_bikes[*].model\")\n        );\n        System.out.println(res32);  // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex18",
      "language": "javascript",
      "code": "const res30 = await client.json.get(\"bikes:inventory\", {\n  path: \"$.inventory.mountain_bikes[*].model\"\n});\nconsole.log(res30); //  ['Phoebe', 'Quaoar', 'Weywot']\n\nconst res31 = await client.json.get(\"bikes:inventory\", {\n  path: '$.inventory[\"mountain_bikes\"][*].model'\n});\nconsole.log(res31); //  ['Phoebe', 'Quaoar', 'Weywot']\n\nconst res32 = await client.json.get(\"bikes:inventory\", {\n  path: \"$..mountain_bikes[*].model\"\n});\nconsole.log(res32); //  ['Phoebe', 'Quaoar', 'Weywot']",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex19",
      "language": "php",
      "code": "$res3b = $r->jsonget('bikes:inventory', '', '', '', '$.inventory.mountain_bikes[*].model');\n        echo $res3b . PHP_EOL;\n        // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]\n\n        $res4b = $r->jsonget('bikes:inventory', '', '', '', '$.inventory[\"mountain_bikes\"][*].model');\n        echo $res4b . PHP_EOL;\n        // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]\n\n        $res5b = $r->jsonget('bikes:inventory', '', '', '', '$..mountain_bikes[*].model');\n        echo $res5b . PHP_EOL;\n        // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex20",
      "language": "python",
      "code": "res3 = r.json().get(\"bikes:inventory\", \"$.inventory.mountain_bikes[*].model\")\nprint(res3)  # >>> [['Phoebe', 'Quaoar', 'Weywot']]\n\nres4 = r.json().get(\"bikes:inventory\", '$.inventory[\"mountain_bikes\"][*].model')\nprint(res4)  # >>> [['Phoebe', 'Quaoar', 'Weywot']]\n\nres5 = r.json().get(\"bikes:inventory\", \"$..mountain_bikes[*].model\")\nprint(res5)  # >>> [['Phoebe', 'Quaoar', 'Weywot']]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex21",
      "language": "ruby",
      "code": "res3 = r.json_get('bikes:inventory', '$.inventory.mountain_bikes[*].model')\np res3 # >>> [\"Phoebe\", \"Quaoar\", \"Weywot\"]\n\nres4 = r.json_get('bikes:inventory', '$.inventory[\"mountain_bikes\"][*].model')\np res4 # >>> [\"Phoebe\", \"Quaoar\", \"Weywot\"]\n\nres5 = r.json_get('bikes:inventory', '$..mountain_bikes[*].model')\np res5 # >>> [\"Phoebe\", \"Quaoar\", \"Weywot\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex22",
      "language": "rust",
      "code": "let res31: String = r\n            .json_get(\"bikes:inventory\", \"$.inventory.mountain_bikes[*].model\")\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res31}\"); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n\n        let res32: String = r\n            .json_get(\n                \"bikes:inventory\",\n                r#\"$.inventory[\"mountain_bikes\"][*].model\"#,\n            )\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res32}\"); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n\n        let res33: String = r\n            .json_get(\"bikes:inventory\", \"$..mountain_bikes[*].model\")\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res33}\"); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex23",
      "language": "rust",
      "code": "let res31: String = r\n            .json_get(\"bikes:inventory\", \"$.inventory.mountain_bikes[*].model\")\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res31}\"); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n\n        let res32: String = r\n            .json_get(\n                \"bikes:inventory\",\n                r#\"$.inventory[\"mountain_bikes\"][*].model\"#,\n            )\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res32}\"); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]\n\n        let res33: String = r\n            .json_get(\"bikes:inventory\", \"$..mountain_bikes[*].model\")\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res33}\"); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\"]]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex24",
      "language": "plaintext",
      "code": "> JSON.GET bikes:inventory $..model\n\"[\\\"Phoebe\\\",\\\"Quaoar\\\",\\\"Weywot\\\",\\\"Salacia\\\",\\\"Mimas\\\"]\"",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex25",
      "language": "csharp",
      "code": "RedisResult res33 = db.JSON().Get(\"bikes:inventory\", path: \"$..model\");\n        Console.WriteLine(res33);   // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex26",
      "language": "go",
      "code": "res6, err := rdb.JSONGet(ctx, \"bikes:inventory\", \"$..model\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res6) // >>> [\"Salacia\",\"Mimas\",\"Phoebe\",\"Quaoar\",\"Weywot\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex27",
      "language": "java",
      "code": "CompletableFuture<Void> getModels = asyncCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..model\"))\n                    .thenAccept(System.out::println)\n                    // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]]\n                    .toCompletableFuture();",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex28",
      "language": "java",
      "code": "Mono<Void> getModels = reactiveCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..model\")).collectList()\n                    .doOnNext(System.out::println) // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]]\n                    .then();",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex29",
      "language": "java",
      "code": "Object res33 = jedis.jsonGet(\"bikes:inventory\", new Path2(\"$..model\"));\n        System.out.println(res33);\n        // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex30",
      "language": "javascript",
      "code": "const res33 = await client.json.get(\"bikes:inventory\", {\n  path: \"$..model\"\n});\nconsole.log(res33); //  ['Phoebe', 'Quaoar', 'Weywot', 'Salacia', 'Mimas']",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex31",
      "language": "php",
      "code": "$res6b = $r->jsonget('bikes:inventory', '', '', '', '$..model');\n        echo $res6b . PHP_EOL;\n        // >>> [\"Phoebe\",\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex32",
      "language": "python",
      "code": "res6 = r.json().get(\"bikes:inventory\", \"$..model\")\nprint(res6)  # >>> [['Phoebe', 'Quaoar', 'Weywot', 'Salacia', 'Mimas']]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex33",
      "language": "ruby",
      "code": "res6 = r.json_get('bikes:inventory', '$..model')\np res6 # >>> [\"Phoebe\", \"Quaoar\", \"Weywot\", \"Salacia\", \"Mimas\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex34",
      "language": "rust",
      "code": "let res34: String = r\n            .json_get(\"bikes:inventory\", \"$..model\")\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res34}\"); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex35",
      "language": "rust",
      "code": "let res34: String = r\n            .json_get(\"bikes:inventory\", \"$..model\")\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res34}\"); // >>> [[\"Phoebe\",\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex36",
      "language": "plaintext",
      "code": "> JSON.GET bikes:inventory $..mountain_bikes[0:2].model\n\"[\\\"Phoebe\\\",\\\"Quaoar\\\"]\"",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex37",
      "language": "csharp",
      "code": "RedisResult res34 = db.JSON().Get(\"bikes:inventory\", path: \"$..mountain_bikes[0:2].model\");\n        Console.WriteLine(res34);   // >>> [\"Phoebe\",\"Quaoar\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex38",
      "language": "go",
      "code": "res7, err := rdb.JSONGet(ctx, \"bikes:inventory\", \"$..mountain_bikes[0:2].model\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res7) // >>> [\"Phoebe\",\"Quaoar\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex39",
      "language": "java",
      "code": "CompletableFuture<Void> get2MtnBikes = asyncCommands\n                    .jsonGet(\"bikes:inventory\", JsonPath.of(\"$..mountain_bikes[0:2].model\"))\n                    .thenAccept(System.out::println)\n                    // >>> [[\"Phoebe\",\"Quaoar\"]]\n                    .toCompletableFuture();",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex40",
      "language": "java",
      "code": "Mono<Void> get2MtnBikes = reactiveCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..mountain_bikes[0:2].model\"))\n                    .collectList()\n                    .doOnNext(System.out::println) // >>> [[\"Phoebe\",\"Quaoar\"]]\n                    .then();",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex41",
      "language": "java",
      "code": "Object res34 = jedis.jsonGet(\n            \"bikes:inventory\", new Path2(\"$..mountain_bikes[0:2].model\")\n        );\n        System.out.println(res34);  // >>> [\"Phoebe\",\"Quaoar\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex42",
      "language": "javascript",
      "code": "const res34 = await client.json.get(\"bikes:inventory\", {\n  path: \"$..mountain_bikes[0:2].model\"\n});\nconsole.log(res34); //  ['Phoebe', 'Quaoar']",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex43",
      "language": "php",
      "code": "$res7b = $r->jsonget('bikes:inventory', '', '', '', '$..mountain_bikes[0:2].model');\n        echo $res7b . PHP_EOL;\n        // >>> [\"Phoebe\",\"Quaoar\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex44",
      "language": "python",
      "code": "res7 = r.json().get(\"bikes:inventory\", \"$..mountain_bikes[0:2].model\")\nprint(res7)  # >>> [['Phoebe', 'Quaoar']]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex45",
      "language": "ruby",
      "code": "res7 = r.json_get('bikes:inventory', '$..mountain_bikes[0:2].model')\np res7 # >>> [\"Phoebe\", \"Quaoar\"]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex46",
      "language": "rust",
      "code": "let res35: String = r\n            .json_get(\"bikes:inventory\", \"$..mountain_bikes[0:2].model\")\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res35}\"); // >>> [[\"Phoebe\",\"Quaoar\"]]",
      "section_id": "access-examples"
    },
    {
      "id": "access-examples-ex47",
      "language": "rust",
      "code": "let res35: String = r\n            .json_get(\"bikes:inventory\", \"$..mountain_bikes[0:2].model\")\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res35}\"); // >>> [[\"Phoebe\",\"Quaoar\"]]",
      "section_id": "access-examples"
    },
    {
      "id": "filter-examples-ex0",
      "language": "plaintext",
      "code": "> JSON.GET bikes:inventory '$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]'\n\"[{\\\"id\\\":\\\"bike:2\\\",\\\"model\\\":\\\"Quaoar\\\",\\\"description\\\":\\\"Redesigned for the 2020 model year, this bike impressed our testers and is the best all-around trail bike we've ever tested. The Shimano gear system effectively does away with an external cassette, so is super low maintenance in terms of wear and tear. All in all it's an impressive package for the price, making it very competitive.\\\",\\\"price\\\":2072,\\\"specs\\\":{\\\"material\\\":\\\"aluminium\\\",\\\"weight\\\":7.9},\\\"colors\\\":[\\\"black\\\",\\\"white\\\"]}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex1",
      "language": "csharp",
      "code": "RedisResult res35 = db.JSON().Get(\n            \"bikes:inventory\",\n            path: \"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]\"\n        );\n        Console.WriteLine(res35);\n        // >>> [{\"id\":\"bike:2\",\"model\":\"Quaoar\",\"description\":\"Redesigned for the 2020 model year...",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex2",
      "language": "go",
      "code": "res8, err := rdb.JSONGetWithArgs(ctx, \"bikes:inventory\",\n\t\t&redis.JSONGetArgs{Indent: \"  \", Newline: \"\\n\", Space: \" \"},\n\t\t\"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res8)\n\t// >>>\n\t// [\n\t//   {\n\t//     \"colors\": [\n\t//       \"black\",\n\t//       \"white\"\n\t//     ],\n\t//     \"description\": \"Redesigned for the 2020 model year\n\t// ...",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex3",
      "language": "java",
      "code": "CompletableFuture<Void> filter1 = asyncCommands\n                    .jsonGet(\"bikes:inventory\", JsonPath.of(\"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]\"))\n                    .thenAccept(System.out::println)\n                    // >>> [[{\"id\":\"bike:2\",\"model\":\"Quaoar\",\"description\":...\n                    .toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex4",
      "language": "java",
      "code": "Mono<Void> filter1 = reactiveCommands\n                    .jsonGet(\"bikes:inventory\", JsonPath.of(\"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]\"))\n                    .collectList()\n                    .doOnNext(System.out::println) // >>> [[{\"id\":\"bike:2\",\"model\":\"Quaoar\",\"description\":...\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex5",
      "language": "java",
      "code": "Object res35 = jedis.jsonGet(\n            \"bikes:inventory\",\n            new Path2(\"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]\")\n        );\n        System.out.println(res35);\n        // >>> [{\"specs\":{\"material\":\"aluminium\",\"weight\":7.9},\"price\":2072,...",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex6",
      "language": "javascript",
      "code": "const res35 = await client.json.get(\"bikes:inventory\", {\n  path: \"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]\"\n});\nconsole.log(res35);\n/*\n[\n  {\n    id: 'bike:2',\n    model: 'Quaoar',\n    description: \"Redesigned for the 2020 model year, this bike impressed our testers and is the best all-around trail bike we've ever tested. The Shimano gear system effectively does away with an external cassette, so is super low maintenance in terms of wear and teaawait client. All in all it's an impressive package for the price, making it very competitive.\",\n    price: 2072,\n    specs: { material: 'aluminium', weight: 7.9 },\n    colors: [ 'black', 'white' ]\n  }\n]\n*/",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex7",
      "language": "php",
      "code": "$res8b = $r->jsonget(\n            'bikes:inventory',\n            '',\n            '',\n            '',\n            '$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]'\n        );\n        echo $res8b . PHP_EOL;\n        // >>> [{\"id\":\"bike:2\",\"model\":\"Quaoar\",...}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex8",
      "language": "python",
      "code": "res8 = r.json().get(\n    \"bikes:inventory\",\n    \"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]\",\n)\nprint(res8)\n# >>> [{'id': 'bike:2', 'model': 'Quaoar',\n#           'description': \"Redesigned for the 2020 model year...",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex9",
      "language": "ruby",
      "code": "res8 = r.json_get(\n  'bikes:inventory',\n  '$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]'\n)\np res8\n# >>> [{\"id\"=>\"bike:2\", \"model\"=>\"Quaoar\",\n# >>>   \"description\"=>\"Redesigned for the 2020 model year...",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex10",
      "language": "rust",
      "code": "let res36: String = r\n            .json_get(\n                \"bikes:inventory\",\n                \"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]\",\n            )\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res36}\");\n        // >>> [[{\"id\":\"bike:2\",\"model\":\"Quaoar\",\"description\":\"Redesigned for the 2020 model year...",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex11",
      "language": "rust",
      "code": "let res36: String = r\n            .json_get(\n                \"bikes:inventory\",\n                \"$..mountain_bikes[?(@.price < 3000 && @.specs.weight < 10)]\",\n            )\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res36}\");\n        // >>> [[{\"id\":\"bike:2\",\"model\":\"Quaoar\",\"description\":\"Redesigned for the 2020 model year...",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex12",
      "language": "plaintext",
      "code": "> JSON.GET bikes:inventory '$..[?(@.specs.material == \"alloy\")].model'\n\"[\\\"Weywot\\\",\\\"Mimas\\\"]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex13",
      "language": "csharp",
      "code": "RedisResult res36 = db.JSON().Get(\n            \"bikes:inventory\",\n            path: \"$..[?(@.specs.material == 'alloy')].model\"\n        );\n        Console.WriteLine(res36);   // >>> [\"Weywot\",\"Mimas\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex14",
      "language": "go",
      "code": "res9, err := rdb.JSONGet(ctx,\n\t\t\"bikes:inventory\",\n\t\t\"$..[?(@.specs.material == 'alloy')].model\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res9) // >>> [\"Mimas\",\"Weywot\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex15",
      "language": "java",
      "code": "CompletableFuture<Void> filter2 = asyncCommands\n                    .jsonGet(\"bikes:inventory\", JsonPath.of(\"$..[?(@.specs.material == 'alloy')].model\"))\n                    .thenAccept(System.out::println)\n                    // >>> [[\"Weywot\",\"Mimas\"]]\n                    .toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex16",
      "language": "java",
      "code": "Mono<Void> filter2 = reactiveCommands\n                    .jsonGet(\"bikes:inventory\", JsonPath.of(\"$..[?(@.specs.material == 'alloy')].model\")).collectList()\n                    .doOnNext(System.out::println) // >>> [[\"Weywot\",\"Mimas\"]]\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex17",
      "language": "java",
      "code": "Object res36 = jedis.jsonGet(\n            \"bikes:inventory\", new Path2(\"$..[?(@.specs.material == 'alloy')].model\")\n        );\n        System.out.println(res36);  // >>> [\"Weywot\",\"Mimas\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex18",
      "language": "javascript",
      "code": "//  names of bikes made from an alloy\nconst res36 = await client.json.get(\"bikes:inventory\", {\n  path: \"$..[?(@.specs.material == 'alloy')].model\"\n});\nconsole.log(res36); //  ['Weywot', 'Mimas']",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex19",
      "language": "php",
      "code": "$res9b = $r->jsonget('bikes:inventory', '', '', '', \"$..[?(@.specs.material == 'alloy')].model\");\n        echo $res9b . PHP_EOL;\n        // >>> [\"Weywot\",\"Mimas\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex20",
      "language": "python",
      "code": "res9 = r.json().get(\"bikes:inventory\", \"$..[?(@.specs.material == 'alloy')].model\")\nprint(res9)  # >>> ['Weywot', 'Mimas']",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex21",
      "language": "ruby",
      "code": "res9 = r.json_get('bikes:inventory', \"$..[?(@.specs.material == 'alloy')].model\")\np res9 # >>> [\"Weywot\", \"Mimas\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex22",
      "language": "rust",
      "code": "let res37: String = r\n            .json_get(\n                \"bikes:inventory\",\n                \"$..[?(@.specs.material == 'alloy')].model\",\n            )\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res37}\"); // >>> [[\"Weywot\",\"Mimas\"]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex23",
      "language": "rust",
      "code": "let res37: String = r\n            .json_get(\n                \"bikes:inventory\",\n                \"$..[?(@.specs.material == 'alloy')].model\",\n            )\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res37}\"); // >>> [[\"Weywot\",\"Mimas\"]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex24",
      "language": "plaintext",
      "code": "> JSON.GET bikes:inventory '$..[?(@.specs.material =~ \"(?i)al\")].model'\n\"[\\\"Quaoar\\\",\\\"Weywot\\\",\\\"Salacia\\\",\\\"Mimas\\\"]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex25",
      "language": "csharp",
      "code": "RedisResult res37 = db.JSON().Get(\n            \"bikes:inventory\",\n            path: \"$..[?(@.specs.material =~ '(?i)al')].model\"\n        );\n        Console.WriteLine(res37);   // >>> [\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex26",
      "language": "go",
      "code": "res10, err := rdb.JSONGet(ctx,\n\t\t\"bikes:inventory\",\n\t\t\"$..[?(@.specs.material =~ '(?i)al')].model\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res10) // >>> [\"Salacia\",\"Mimas\",\"Quaoar\",\"Weywot\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex27",
      "language": "java",
      "code": "CompletableFuture<Void> filter3 = asyncCommands\n                    .jsonGet(\"bikes:inventory\", JsonPath.of(\"$..[?(@.specs.material =~ '(?i)al')].model\"))\n                    .thenAccept(System.out::println)\n                    // >>> [[\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]]\n                    .toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex28",
      "language": "java",
      "code": "Mono<Void> filter3 = reactiveCommands\n                    .jsonGet(\"bikes:inventory\", JsonPath.of(\"$..[?(@.specs.material =~ '(?i)al')].model\")).collectList()\n                    .doOnNext(System.out::println) // >>> [[\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]]\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex29",
      "language": "java",
      "code": "Object res37 = jedis.jsonGet(\n            \"bikes:inventory\", new Path2(\"$..[?(@.specs.material =~ '(?i)al')].model\")\n        );\n        System.out.println(res37);\n        // >>> [\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex30",
      "language": "javascript",
      "code": "const res37 = await client.json.get(\"bikes:inventory\", {\n  path: \"$..[?(@.specs.material =~ '(?i)al')].model\"\n});\nconsole.log(res37); //  ['Quaoar', 'Weywot', 'Salacia', 'Mimas']",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex31",
      "language": "php",
      "code": "$res10b = $r->jsonget('bikes:inventory', '', '', '', \"$..[?(@.specs.material =~ '(?i)al')].model\");\n        echo $res10b . PHP_EOL;\n        // >>> [\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex32",
      "language": "python",
      "code": "res10 = r.json().get(\"bikes:inventory\", \"$..[?(@.specs.material =~ '(?i)al')].model\")\nprint(res10)  # >>> ['Quaoar', 'Weywot', 'Salacia', 'Mimas']",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex33",
      "language": "ruby",
      "code": "res10 = r.json_get('bikes:inventory', \"$..[?(@.specs.material =~ '(?i)al')].model\")\np res10 # >>> [\"Quaoar\", \"Weywot\", \"Salacia\", \"Mimas\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex34",
      "language": "rust",
      "code": "let res38: String = r\n            .json_get(\n                \"bikes:inventory\",\n                \"$..[?(@.specs.material =~ '(?i)al')].model\",\n            )\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res38}\"); // >>> [[\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex35",
      "language": "rust",
      "code": "let res38: String = r\n            .json_get(\n                \"bikes:inventory\",\n                \"$..[?(@.specs.material =~ '(?i)al')].model\",\n            )\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res38}\"); // >>> [[\"Quaoar\",\"Weywot\",\"Salacia\",\"Mimas\"]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex36",
      "language": "plaintext",
      "code": "> JSON.SET bikes:inventory $.inventory.mountain_bikes[0].regex_pat '\"(?i)al\"'\nOK\n> JSON.SET bikes:inventory $.inventory.mountain_bikes[1].regex_pat '\"(?i)al\"'\nOK\n> JSON.SET bikes:inventory $.inventory.mountain_bikes[2].regex_pat '\"(?i)al\"'\nOK\n> JSON.GET bikes:inventory '$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model'\n\"[\\\"Quaoar\\\",\\\"Weywot\\\"]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex37",
      "language": "csharp",
      "code": "bool res38 = db.JSON().Set(\n            \"bikes:inventory\",\n            \"$.inventory.mountain_bikes[0].regex_pat\",\n            \"\\\"(?i)al\\\"\"\n        );\n        Console.WriteLine(res38);   // >>> True\n\n        bool res39 = db.JSON().Set(\n            \"bikes:inventory\",\n            \"$.inventory.mountain_bikes[1].regex_pat\",\n            \"\\\"(?i)al\\\"\"\n        );\n        Console.WriteLine(res39);   // >>> True\n\n        bool res40 = db.JSON().Set(\n            \"bikes:inventory\",\n            \"$.inventory.mountain_bikes[2].regex_pat\",\n            \"\\\"(?i)al\\\"\"\n        );\n        Console.WriteLine(res40);   // >>> True\n\n        RedisResult res41 = db.JSON().Get(\n            \"bikes:inventory\",\n            path: \"$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model\"\n        );\n        Console.WriteLine(res41);   // >>> [\"Quaoar\",\"Weywot\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex38",
      "language": "go",
      "code": "res11, err := rdb.JSONSet(ctx,\n\t\t\"bikes:inventory\",\n\t\t\"$.inventory.mountain_bikes[0].regex_pat\",\n\t\t\"\\\"(?i)al\\\"\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res11) // >>> OK\n\n\tres12, err := rdb.JSONSet(ctx,\n\t\t\"bikes:inventory\",\n\t\t\"$.inventory.mountain_bikes[1].regex_pat\",\n\t\t\"\\\"(?i)al\\\"\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res12) // >>> OK\n\n\tres13, err := rdb.JSONSet(ctx,\n\t\t\"bikes:inventory\",\n\t\t\"$.inventory.mountain_bikes[2].regex_pat\",\n\t\t\"\\\"(?i)al\\\"\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res13) // >>> OK\n\n\tres14, err := rdb.JSONGet(ctx,\n\t\t\"bikes:inventory\",\n\t\t\"$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res14) // >>> [\"Quaoar\",\"Weywot\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex39",
      "language": "java",
      "code": "CompletableFuture<Void> filter4 = asyncCommands.jsonSet(\"bikes:inventory\",\n                    JsonPath.of(\"$.inventory.mountain_bikes[0].regex_pat\"), parser.createJsonValue(\"\\\"(?i)al\\\"\"))\n                    .thenCompose(r -> {\n                        System.out.println(r); // >>> OK\n\n                        return asyncCommands.jsonSet(\"bikes:inventory\", JsonPath.of(\"$.inventory.mountain_bikes[1].regex_pat\"),\n                                parser.createJsonValue(\"\\\"(?i)al\\\"\"));\n                    }).thenCompose(r -> {\n                        System.out.println(r); // >>> OK\n\n                        return asyncCommands.jsonSet(\"bikes:inventory\", JsonPath.of(\"$.inventory.mountain_bikes[2].regex_pat\"),\n                                parser.createJsonValue(\"\\\"(?i)al\\\"\"));\n                    }).thenCompose(res22 -> {\n                        System.out.println(res22); // >>> OK\n\n                        return asyncCommands.jsonGet(\"bikes:inventory\",\n                                JsonPath.of(\"$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model\"));\n                    })\n                    .thenAccept(System.out::println)\n                    // >>> [[\"Quaoar\",\"Weywot\"]]\n                    .toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex40",
      "language": "java",
      "code": "Mono<Void> filter4 = reactiveCommands.jsonSet(\"bikes:inventory\",\n                    JsonPath.of(\"$.inventory.mountain_bikes[0].regex_pat\"), parser.createJsonValue(\"\\\"(?i)al\\\"\"))\n                    .doOnNext(r -> {\n                        System.out.println(r); // >>> OK\n                    })\n                    .flatMap(r -> reactiveCommands.jsonSet(\"bikes:inventory\",\n                            JsonPath.of(\"$.inventory.mountain_bikes[1].regex_pat\"), parser.createJsonValue(\"\\\"(?i)al\\\"\")))\n                    .doOnNext(r -> {\n                        System.out.println(r); // >>> OK\n                    })\n                    .flatMap(r -> reactiveCommands.jsonSet(\"bikes:inventory\",\n                            JsonPath.of(\"$.inventory.mountain_bikes[2].regex_pat\"), parser.createJsonValue(\"\\\"(?i)al\\\"\")))\n                    .doOnNext(res22 -> {\n                        System.out.println(res22); // >>> OK\n                    })\n                    .flatMap(res22 -> reactiveCommands\n                            .jsonGet(\"bikes:inventory\",\n                                    JsonPath.of(\"$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model\"))\n                            .collectList())\n                    .doOnNext(System.out::println) // >>> [[\"Quaoar\",\"Weywot\"]]\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex41",
      "language": "java",
      "code": "jedis.jsonSet(\n            \"bikes:inventory\", new Path2(\"$.inventory.mountain_bikes[0].regex_pat\"),\n            \"\\\"(?i)al\\\"\"\n        );\n        jedis.jsonSet(\n            \"bikes:inventory\", new Path2(\"$.inventory.mountain_bikes[1].regex_pat\"),\n            \"\\\"(?i)al\\\"\"\n        );\n        jedis.jsonSet(\n            \"bikes:inventory\", new Path2(\"$.inventory.mountain_bikes[2].regex_pat\"),\n            \"\\\"(?i)al\\\"\"\n        );\n        \n        Object res38 = jedis.jsonGet(\n            \"bikes:inventory\",\n            new Path2(\"$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model\")\n        );\n        System.out.println(res38);  // >>> [\"Quaoar\",\"Weywot\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex42",
      "language": "javascript",
      "code": "const res37a = await client.json.set(\n  'bikes:inventory', \n  '$.inventory.mountain_bikes[0].regex_pat', \n  '(?i)al'\n);\n\nconst res37b = await client.json.set(\n  'bikes:inventory', \n  '$.inventory.mountain_bikes[1].regex_pat', \n  '(?i)al'\n);\n\nconst res37c = await client.json.set(\n  'bikes:inventory', \n  '$.inventory.mountain_bikes[2].regex_pat', \n  '(?i)al'\n);\n\nconst res37d = await client.json.get(\n  'bikes:inventory',\n  { path: '$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model' }\n);\nconsole.log(res37d); // ['Quaoar', 'Weywot']",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex43",
      "language": "php",
      "code": "$r->jsonset('bikes:inventory', '$.inventory.mountain_bikes[0].regex_pat', '\"(?i)al\"');\n        $r->jsonset('bikes:inventory', '$.inventory.mountain_bikes[1].regex_pat', '\"(?i)al\"');\n        $r->jsonset('bikes:inventory', '$.inventory.mountain_bikes[2].regex_pat', '\"(?i)al\"');\n\n        $res14b = $r->jsonget(\n            'bikes:inventory',\n            '',\n            '',\n            '',\n            '$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model'\n        );\n        echo $res14b . PHP_EOL;\n        // >>> [\"Quaoar\",\"Weywot\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex44",
      "language": "python",
      "code": "res11 = r.json().set(\n    \"bikes:inventory\", \"$.inventory.mountain_bikes[0].regex_pat\", \"(?i)al\"\n)\nres12 = r.json().set(\n    \"bikes:inventory\", \"$.inventory.mountain_bikes[1].regex_pat\", \"(?i)al\"\n)\nres13 = r.json().set(\n    \"bikes:inventory\", \"$.inventory.mountain_bikes[2].regex_pat\", \"(?i)al\"\n)\n\nres14 = r.json().get(\n    \"bikes:inventory\",\n    \"$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model\",\n)\nprint(res14)  # >>> ['Quaoar', 'Weywot']",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex45",
      "language": "ruby",
      "code": "res11 = r.json_set(\n  'bikes:inventory', '$.inventory.mountain_bikes[0].regex_pat', '(?i)al'\n)\nres12 = r.json_set(\n  'bikes:inventory', '$.inventory.mountain_bikes[1].regex_pat', '(?i)al'\n)\nres13 = r.json_set(\n  'bikes:inventory', '$.inventory.mountain_bikes[2].regex_pat', '(?i)al'\n)\n\nres14 = r.json_get(\n  'bikes:inventory',\n  '$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model'\n)\np res14 # >>> [\"Quaoar\", \"Weywot\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex46",
      "language": "rust",
      "code": "let _: bool = r\n            .json_set(\n                \"bikes:inventory\",\n                \"$.inventory.mountain_bikes[0].regex_pat\",\n                &json!(\"(?i)al\"),\n            )\n            .await\n            .expect(\"Failed to run JSON.SET\");\n        let _: bool = r\n            .json_set(\n                \"bikes:inventory\",\n                \"$.inventory.mountain_bikes[1].regex_pat\",\n                &json!(\"(?i)al\"),\n            )\n            .await\n            .expect(\"Failed to run JSON.SET\");\n        let _: bool = r\n            .json_set(\n                \"bikes:inventory\",\n                \"$.inventory.mountain_bikes[2].regex_pat\",\n                &json!(\"(?i)al\"),\n            )\n            .await\n            .expect(\"Failed to run JSON.SET\");\n\n        let res39: String = r\n            .json_get(\n                \"bikes:inventory\",\n                \"$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model\",\n            )\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res39}\"); // >>> [[\"Quaoar\",\"Weywot\"]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex47",
      "language": "rust",
      "code": "let _: bool = r\n            .json_set(\n                \"bikes:inventory\",\n                \"$.inventory.mountain_bikes[0].regex_pat\",\n                &json!(\"(?i)al\"),\n            )\n            .expect(\"Failed to run JSON.SET\");\n        let _: bool = r\n            .json_set(\n                \"bikes:inventory\",\n                \"$.inventory.mountain_bikes[1].regex_pat\",\n                &json!(\"(?i)al\"),\n            )\n            .expect(\"Failed to run JSON.SET\");\n        let _: bool = r\n            .json_set(\n                \"bikes:inventory\",\n                \"$.inventory.mountain_bikes[2].regex_pat\",\n                &json!(\"(?i)al\"),\n            )\n            .expect(\"Failed to run JSON.SET\");\n\n        let res39: String = r\n            .json_get(\n                \"bikes:inventory\",\n                \"$.inventory.mountain_bikes[?(@.specs.material =~ @.regex_pat)].model\",\n            )\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res39}\"); // >>> [[\"Quaoar\",\"Weywot\"]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex48",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '[{\"a\":1,\"b\":1},{\"b\":2},{\"a\":1},{\"c\":3}]'\nOK\n> JSON.GET doc '$[?!@.a]'\n\"[{\\\"b\\\":2},{\\\"c\\\":3}]\"\n> JSON.GET doc '$[?!(@.a==1)]'\n\"[{\\\"b\\\":2},{\\\"c\\\":3}]\"\n> JSON.GET doc '$[?!@.a && @.b]'\n\"[{\\\"b\\\":2}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex49",
      "language": "csharp",
      "code": "bool res1 = db.JSON().Set(\"doc\", \"$\", \"[{\\\"a\\\":1,\\\"b\\\":1},{\\\"b\\\":2},{\\\"a\\\":1},{\\\"c\\\":3}]\");\n        Console.WriteLine(res1);    // >>> True\n\n        RedisResult res2 = db.JSON().Get(\"doc\", path: \"$[?!@.a]\");\n        Console.WriteLine(res2);    // >>> [{\"b\":2},{\"c\":3}]\n\n        RedisResult res3 = db.JSON().Get(\"doc\", path: \"$[?!(@.a==1)]\");\n        Console.WriteLine(res3);    // >>> [{\"b\":2},{\"c\":3}]\n\n        RedisResult res4 = db.JSON().Get(\"doc\", path: \"$[?!@.a && @.b]\");\n        Console.WriteLine(res4);    // >>> [{\"b\":2}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex50",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`[{\"a\":1,\"b\":1},{\"b\":2},{\"a\":1},{\"c\":3}]`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$[?!@.a]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [{\"b\":2},{\"c\":3}]\n\n\tres3, err := rdb.JSONGet(ctx, \"doc\", `$[?!(@.a==1)]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> [{\"b\":2},{\"c\":3}]\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$[?!@.a && @.b]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [{\"b\":2}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex51",
      "language": "java",
      "code": "CompletableFuture<Void> filterNegationExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"[{\\\"a\\\":1,\\\"b\\\":1},{\\\"b\\\":2},{\\\"a\\\":1},{\\\"c\\\":3}]\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$[?!@.a]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[{\"b\":2},{\"c\":3}]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$[?!(@.a==1)]\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> [[{\"b\":2},{\"c\":3}]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$[?!@.a && @.b]\"));\n                    }).thenAccept(res4 -> {\n                        System.out.println(res4); // >>> [[{\"b\":2}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex52",
      "language": "java",
      "code": "Mono<Void> filterNegationExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"[{\\\"a\\\":1,\\\"b\\\":1},{\\\"b\\\":2},{\\\"a\\\":1},{\\\"c\\\":3}]\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$[?!@.a]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[{\"b\":2},{\"c\":3}]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$[?!(@.a==1)]\")).collectList())\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> [[{\"b\":2},{\"c\":3}]]\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$[?!@.a && @.b]\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[{\"b\":2}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex53",
      "language": "java",
      "code": "String res1 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"[{\\\"a\\\":1,\\\"b\\\":1},{\\\"b\\\":2},{\\\"a\\\":1},{\\\"c\\\":3}]\");\n        System.out.println(res1);    // >>> OK\n\n        Object res2 = jedis.jsonGet(\"doc\", new Path2(\"$[?!@.a]\"));\n        System.out.println(res2);    // >>> [{\"b\":2},{\"c\":3}]\n\n        Object res3 = jedis.jsonGet(\"doc\", new Path2(\"$[?!(@.a==1)]\"));\n        System.out.println(res3);    // >>> [{\"b\":2},{\"c\":3}]\n\n        Object res4 = jedis.jsonGet(\"doc\", new Path2(\"$[?!@.a && @.b]\"));\n        System.out.println(res4);    // >>> [{\"b\":2}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex54",
      "language": "javascript",
      "code": "const res1 = await client.json.set('doc', '$', [{ a: 1, b: 1 }, { b: 2 }, { a: 1 }, { c: 3 }]);\nconsole.log(res1); // >>> OK\n\nconst res2 = await client.json.get('doc', { path: '$[?!@.a]' });\nconsole.log(res2); // >>> [ { b: 2 }, { c: 3 } ]\n\nconst res3 = await client.json.get('doc', { path: '$[?!(@.a==1)]' });\nconsole.log(res3); // >>> [ { b: 2 }, { c: 3 } ]\n\nconst res4 = await client.json.get('doc', { path: '$[?!@.a && @.b]' });\nconsole.log(res4); // >>> [ { b: 2 } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex55",
      "language": "php",
      "code": "$res1 = $this->redis->jsonset('doc', '$', json_encode(\n            [[\"a\" => 1, \"b\" => 1], [\"b\" => 2], [\"a\" => 1], [\"c\" => 3]]\n        ));\n        echo $res1 . PHP_EOL; // >>> OK\n\n        $res2 = $this->redis->jsonget('doc', '', '', '', '$[?!@.a]');\n        echo $res2 . PHP_EOL; // >>> [{\"b\":2},{\"c\":3}]\n\n        $res3 = $this->redis->jsonget('doc', '', '', '', '$[?!(@.a==1)]');\n        echo $res3 . PHP_EOL; // >>> [{\"b\":2},{\"c\":3}]\n\n        $res4 = $this->redis->jsonget('doc', '', '', '', '$[?!@.a && @.b]');\n        echo $res4 . PHP_EOL; // >>> [{\"b\":2}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex56",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", [{\"a\": 1, \"b\": 1}, {\"b\": 2}, {\"a\": 1}, {\"c\": 3}])\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$[?!@.a]\")\nprint(res2)\n# >>> [{'b': 2}, {'c': 3}]\n\nres3 = r.json().get(\"doc\", \"$[?!(@.a==1)]\")\nprint(res3)\n# >>> [{'b': 2}, {'c': 3}]\n\nres4 = r.json().get(\"doc\", \"$[?!@.a && @.b]\")\nprint(res4)\n# >>> [{'b': 2}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex57",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', [{ 'a' => 1, 'b' => 1 }, { 'b' => 2 }, { 'a' => 1 }, { 'c' => 3 }])\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$[?!@.a]')\np res2 # >>> [{\"b\"=>2}, {\"c\"=>3}]\n\nres3 = r.json_get('doc', '$[?!(@.a==1)]')\np res3 # >>> [{\"b\"=>2}, {\"c\"=>3}]\n\nres4 = r.json_get('doc', '$[?!@.a && @.b]')\np res4 # >>> [{\"b\"=>2}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex58",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!([{\"a\":1,\"b\":1},{\"b\":2},{\"a\":1},{\"c\":3}])).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$[?!@.a]\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [{\"b\":2},{\"c\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?!(@.a==1)]\").await {\n            Ok(res2) => {\n                let res2: String = res2;\n                println!(\"{res2}\");    // >>> [{\"b\":2},{\"c\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?!@.a && @.b]\").await {\n            Ok(res3) => {\n                let res3: String = res3;\n                println!(\"{res3}\");    // >>> [{\"b\":2}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex59",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!([{\"a\":1,\"b\":1},{\"b\":2},{\"a\":1},{\"c\":3}])) {\n            Ok(res1) => {\n                let res1: bool = res1;\n                println!(\"{}\", if res1 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?!@.a]\") {\n            Ok(res2) => {\n                let res2: String = res2;\n                println!(\"{res2}\");    // >>> [{\"b\":2},{\"c\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?!(@.a==1)]\") {\n            Ok(res3) => {\n                let res3: String = res3;\n                println!(\"{res3}\");    // >>> [{\"b\":2},{\"c\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?!@.a && @.b]\") {\n            Ok(res4) => {\n                let res4: String = res4;\n                println!(\"{res4}\");    // >>> [{\"b\":2}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex60",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"arrs\":[[1],[2],[1,2],[1,[2]]],\"objs\":[{\"x\":1},{\"x\":2},{\"y\":1}]}'\nOK\n> JSON.GET doc '$.arrs[?(@ == [1])]'\n\"[[1]]\"\n> JSON.GET doc '$.arrs[?(@ == [1,[2]])]'\n\"[[1,[2]]]\"\n> JSON.GET doc '$.objs[?(@ == {\"x\":1})]'\n\"[{\\\"x\\\":1}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex61",
      "language": "csharp",
      "code": "bool res5 = db.JSON().Set(\n            \"doc\",\n            \"$\",\n            \"{\\\"arrs\\\":[[1],[2],[1,2],[1,[2]]],\\\"objs\\\":[{\\\"x\\\":1},{\\\"x\\\":2},{\\\"y\\\":1}]}\"\n        );\n        Console.WriteLine(res5);    // >>> True\n\n        RedisResult res6 = db.JSON().Get(\"doc\", path: \"$.arrs[?(@ == [1])]\");\n        Console.WriteLine(res6);    // >>> [[1]]\n\n        RedisResult res7 = db.JSON().Get(\"doc\", path: \"$.arrs[?(@ == [1,[2]])]\");\n        Console.WriteLine(res7);    // >>> [[1,[2]]]\n\n        RedisResult res8 = db.JSON().Get(\"doc\", path: \"$.objs[?(@ == {\\\"x\\\":1})]\");\n        Console.WriteLine(res8);    // >>> [{\"x\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex62",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"arrs\":[[1],[2],[1,2],[1,[2]]],\"objs\":[{\"x\":1},{\"x\":2},{\"y\":1}]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.arrs[?(@ == [1])]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [[1]]\n\n\tres3, err := rdb.JSONGet(ctx, \"doc\", `$.arrs[?(@ == [1,[2]])]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> [[1,[2]]]\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$.objs[?(@ == {\"x\":1})]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [{\"x\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex63",
      "language": "java",
      "code": "CompletableFuture<Void> filterLiteralEqExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\n                                    \"{\\\"arrs\\\":[[1],[2],[1,2],[1,[2]]],\\\"objs\\\":[{\\\"x\\\":1},{\\\"x\\\":2},{\\\"y\\\":1}]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.arrs[?(@ == [1])]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[[1]]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.arrs[?(@ == [1,[2]])]\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> [[[1,[2]]]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.objs[?(@ == {\\\"x\\\":1})]\"));\n                    }).thenAccept(res4 -> {\n                        System.out.println(res4); // >>> [[{\"x\":1}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex64",
      "language": "java",
      "code": "Mono<Void> filterLiteralEqExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\n                                    \"{\\\"arrs\\\":[[1],[2],[1,2],[1,[2]]],\\\"objs\\\":[{\\\"x\\\":1},{\\\"x\\\":2},{\\\"y\\\":1}]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.arrs[?(@ == [1])]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[[1]]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.arrs[?(@ == [1,[2]])]\")).collectList())\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> [[[1,[2]]]]\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.objs[?(@ == {\\\"x\\\":1})]\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[{\"x\":1}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex65",
      "language": "java",
      "code": "String res5 = jedis.jsonSet(\n            \"doc\",\n            new Path2(\"$\"),\n            \"{\\\"arrs\\\":[[1],[2],[1,2],[1,[2]]],\\\"objs\\\":[{\\\"x\\\":1},{\\\"x\\\":2},{\\\"y\\\":1}]}\"\n        );\n        System.out.println(res5);    // >>> OK\n\n        Object res6 = jedis.jsonGet(\"doc\", new Path2(\"$.arrs[?(@ == [1])]\"));\n        System.out.println(res6);    // >>> [[1]]\n\n        Object res7 = jedis.jsonGet(\"doc\", new Path2(\"$.arrs[?(@ == [1,[2]])]\"));\n        System.out.println(res7);    // >>> [[1,[2]]]\n\n        Object res8 = jedis.jsonGet(\"doc\", new Path2(\"$.objs[?(@ == {\\\"x\\\":1})]\"));\n        System.out.println(res8);    // >>> [{\"x\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex66",
      "language": "javascript",
      "code": "const res5 = await client.json.set('doc', '$', {\n  arrs: [[1], [2], [1, 2], [1, [2]]],\n  objs: [{ x: 1 }, { x: 2 }, { y: 1 }]\n});\nconsole.log(res5); // >>> OK\n\nconst res6 = await client.json.get('doc', { path: '$.arrs[?(@ == [1])]' });\nconsole.log(res6); // >>> [ [ 1 ] ]\n\nconst res7 = await client.json.get('doc', { path: '$.arrs[?(@ == [1,[2]])]' });\nconsole.log(res7); // >>> [ [ 1, [ 2 ] ] ]\n\nconst res8 = await client.json.get('doc', { path: '$.objs[?(@ == {\"x\":1})]' });\nconsole.log(res8); // >>> [ { x: 1 } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex67",
      "language": "php",
      "code": "$res5 = $this->redis->jsonset('doc', '$', json_encode([\n            \"arrs\" => [[1], [2], [1, 2], [1, [2]]],\n            \"objs\" => [[\"x\" => 1], [\"x\" => 2], [\"y\" => 1]],\n        ]));\n        echo $res5 . PHP_EOL; // >>> OK\n\n        $res6 = $this->redis->jsonget('doc', '', '', '', '$.arrs[?(@ == [1])]');\n        echo $res6 . PHP_EOL; // >>> [[1]]\n\n        $res7 = $this->redis->jsonget('doc', '', '', '', '$.arrs[?(@ == [1,[2]])]');\n        echo $res7 . PHP_EOL; // >>> [[1,[2]]]\n\n        $res8 = $this->redis->jsonget('doc', '', '', '', '$.objs[?(@ == {\"x\":1})]');\n        echo $res8 . PHP_EOL; // >>> [{\"x\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex68",
      "language": "python",
      "code": "res1 = r.json().set(\n    \"doc\",\n    \"$\",\n    {\"arrs\": [[1], [2], [1, 2], [1, [2]]], \"objs\": [{\"x\": 1}, {\"x\": 2}, {\"y\": 1}]},\n)\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.arrs[?(@ == [1])]\")\nprint(res2)\n# >>> [[1]]\n\nres3 = r.json().get(\"doc\", \"$.arrs[?(@ == [1,[2]])]\")\nprint(res3)\n# >>> [[1, [2]]]\n\nres4 = r.json().get(\"doc\", '$.objs[?(@ == {\"x\":1})]')\nprint(res4)\n# >>> [{'x': 1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex69",
      "language": "ruby",
      "code": "res1 = r.json_set(\n  'doc', '$',\n  { 'arrs' => [[1], [2], [1, 2], [1, [2]]], 'objs' => [{ 'x' => 1 }, { 'x' => 2 }, { 'y' => 1 }] }\n)\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.arrs[?(@ == [1])]')\np res2 # >>> [[1]]\n\nres3 = r.json_get('doc', '$.arrs[?(@ == [1,[2]])]')\np res3 # >>> [[1, [2]]]\n\nres4 = r.json_get('doc', '$.objs[?(@ == {\"x\":1})]')\np res4 # >>> [{\"x\"=>1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex70",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\n            \"doc\",\n            \"$\",\n            &json!({\"arrs\":[[1],[2],[1,2],[1,[2]]],\"objs\":[{\"x\":1},{\"x\":2},{\"y\":1}]}),\n        ).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.arrs[?(@ == [1])]\").await {\n            Ok(res4) => {\n                let res4: String = res4;\n                println!(\"{res4}\");    // >>> [[1]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.arrs[?(@ == [1,[2]])]\").await {\n            Ok(res5) => {\n                let res5: String = res5;\n                println!(\"{res5}\");    // >>> [[1,[2]]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", r#\"$.objs[?(@ == {\"x\":1})]\"#).await {\n            Ok(res6) => {\n                let res6: String = res6;\n                println!(\"{res6}\");    // >>> [{\"x\":1}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex71",
      "language": "rust",
      "code": "match r.json_set(\n            \"doc\",\n            \"$\",\n            &json!({\"arrs\":[[1],[2],[1,2],[1,[2]]],\"objs\":[{\"x\":1},{\"x\":2},{\"y\":1}]}),\n        ) {\n            Ok(res5) => {\n                let res5: bool = res5;\n                println!(\"{}\", if res5 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.arrs[?(@ == [1])]\") {\n            Ok(res6) => {\n                let res6: String = res6;\n                println!(\"{res6}\");    // >>> [[1]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.arrs[?(@ == [1,[2]])]\") {\n            Ok(res7) => {\n                let res7: String = res7;\n                println!(\"{res7}\");    // >>> [[1,[2]]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", r#\"$.objs[?(@ == {\"x\":1})]\"#) {\n            Ok(res8) => {\n                let res8: String = res8;\n                println!(\"{res8}\");    // >>> [{\"x\":1}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex72",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '[{\"a\":2,\"b\":3},{\"a\":5,\"b\":2}]'\nOK\n> JSON.GET doc '$[?@.a + 1 == 3]'\n\"[{\\\"a\\\":2,\\\"b\\\":3}]\"\n> JSON.GET doc '$[?@.a + @.b * 2 == 8]'\n\"[{\\\"a\\\":2,\\\"b\\\":3}]\"\n> JSON.GET doc '$[?(@.a + @.b) * 2 == 10]'\n\"[{\\\"a\\\":2,\\\"b\\\":3}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex73",
      "language": "csharp",
      "code": "bool res9 = db.JSON().Set(\"doc\", \"$\", \"[{\\\"a\\\":2,\\\"b\\\":3},{\\\"a\\\":5,\\\"b\\\":2}]\");\n        Console.WriteLine(res9);    // >>> True\n\n        RedisResult res10 = db.JSON().Get(\"doc\", path: \"$[?@.a + 1 == 3]\");\n        Console.WriteLine(res10);   // >>> [{\"a\":2,\"b\":3}]\n\n        RedisResult res11 = db.JSON().Get(\"doc\", path: \"$[?@.a + @.b * 2 == 8]\");\n        Console.WriteLine(res11);   // >>> [{\"a\":2,\"b\":3}]\n\n        RedisResult res12 = db.JSON().Get(\"doc\", path: \"$[?(@.a + @.b) * 2 == 10]\");\n        Console.WriteLine(res12);   // >>> [{\"a\":2,\"b\":3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex74",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`[{\"a\":2,\"b\":3},{\"a\":5,\"b\":2}]`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$[?@.a + 1 == 3]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [{\"a\":2,\"b\":3}]\n\n\tres3, err := rdb.JSONGet(ctx, \"doc\", `$[?@.a + @.b * 2 == 8]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> [{\"a\":2,\"b\":3}]\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$[?(@.a + @.b) * 2 == 10]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [{\"a\":2,\"b\":3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex75",
      "language": "java",
      "code": "CompletableFuture<Void> filterArithmeticExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"[{\\\"a\\\":2,\\\"b\\\":3},{\\\"a\\\":5,\\\"b\\\":2}]\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$[?@.a + 1 == 3]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[{\"a\":2,\"b\":3}]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$[?@.a + @.b * 2 == 8]\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> [[{\"a\":2,\"b\":3}]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$[?(@.a + @.b) * 2 == 10]\"));\n                    }).thenAccept(res4 -> {\n                        System.out.println(res4); // >>> [[{\"a\":2,\"b\":3}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex76",
      "language": "java",
      "code": "Mono<Void> filterArithmeticExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"[{\\\"a\\\":2,\\\"b\\\":3},{\\\"a\\\":5,\\\"b\\\":2}]\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$[?@.a + 1 == 3]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[{\"a\":2,\"b\":3}]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$[?@.a + @.b * 2 == 8]\")).collectList())\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> [[{\"a\":2,\"b\":3}]]\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$[?(@.a + @.b) * 2 == 10]\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[{\"a\":2,\"b\":3}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex77",
      "language": "java",
      "code": "String res9 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"[{\\\"a\\\":2,\\\"b\\\":3},{\\\"a\\\":5,\\\"b\\\":2}]\");\n        System.out.println(res9);    // >>> OK\n\n        Object res10 = jedis.jsonGet(\"doc\", new Path2(\"$[?@.a + 1 == 3]\"));\n        System.out.println(res10);    // >>> [{\"a\":2,\"b\":3}]\n\n        Object res11 = jedis.jsonGet(\"doc\", new Path2(\"$[?@.a + @.b * 2 == 8]\"));\n        System.out.println(res11);    // >>> [{\"a\":2,\"b\":3}]\n\n        Object res12 = jedis.jsonGet(\"doc\", new Path2(\"$[?(@.a + @.b) * 2 == 10]\"));\n        System.out.println(res12);    // >>> [{\"a\":2,\"b\":3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex78",
      "language": "javascript",
      "code": "const res9 = await client.json.set('doc', '$', [{ a: 2, b: 3 }, { a: 5, b: 2 }]);\nconsole.log(res9); // >>> OK\n\nconst res10 = await client.json.get('doc', { path: '$[?@.a + 1 == 3]' });\nconsole.log(res10); // >>> [ { a: 2, b: 3 } ]\n\nconst res11 = await client.json.get('doc', { path: '$[?@.a + @.b * 2 == 8]' });\nconsole.log(res11); // >>> [ { a: 2, b: 3 } ]\n\nconst res12 = await client.json.get('doc', { path: '$[?(@.a + @.b) * 2 == 10]' });\nconsole.log(res12); // >>> [ { a: 2, b: 3 } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex79",
      "language": "php",
      "code": "$res9 = $this->redis->jsonset('doc', '$', json_encode(\n            [[\"a\" => 2, \"b\" => 3], [\"a\" => 5, \"b\" => 2]]\n        ));\n        echo $res9 . PHP_EOL; // >>> OK\n\n        $res10 = $this->redis->jsonget('doc', '', '', '', '$[?@.a + 1 == 3]');\n        echo $res10 . PHP_EOL; // >>> [{\"a\":2,\"b\":3}]\n\n        $res11 = $this->redis->jsonget('doc', '', '', '', '$[?@.a + @.b * 2 == 8]');\n        echo $res11 . PHP_EOL; // >>> [{\"a\":2,\"b\":3}]\n\n        $res12 = $this->redis->jsonget('doc', '', '', '', '$[?(@.a + @.b) * 2 == 10]');\n        echo $res12 . PHP_EOL; // >>> [{\"a\":2,\"b\":3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex80",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", [{\"a\": 2, \"b\": 3}, {\"a\": 5, \"b\": 2}])\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$[?@.a + 1 == 3]\")\nprint(res2)\n# >>> [{'a': 2, 'b': 3}]\n\nres3 = r.json().get(\"doc\", \"$[?@.a + @.b * 2 == 8]\")\nprint(res3)\n# >>> [{'a': 2, 'b': 3}]\n\nres4 = r.json().get(\"doc\", \"$[?(@.a + @.b) * 2 == 10]\")\nprint(res4)\n# >>> [{'a': 2, 'b': 3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex81",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', [{ 'a' => 2, 'b' => 3 }, { 'a' => 5, 'b' => 2 }])\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$[?@.a + 1 == 3]')\np res2 # >>> [{\"a\"=>2, \"b\"=>3}]\n\nres3 = r.json_get('doc', '$[?@.a + @.b * 2 == 8]')\np res3 # >>> [{\"a\"=>2, \"b\"=>3}]\n\nres4 = r.json_get('doc', '$[?(@.a + @.b) * 2 == 10]')\np res4 # >>> [{\"a\"=>2, \"b\"=>3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex82",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!([{\"a\":2,\"b\":3},{\"a\":5,\"b\":2}])).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$[?@.a + 1 == 3]\").await {\n            Ok(res7) => {\n                let res7: String = res7;\n                println!(\"{res7}\");    // >>> [{\"a\":2,\"b\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?@.a + @.b * 2 == 8]\").await {\n            Ok(res8) => {\n                let res8: String = res8;\n                println!(\"{res8}\");    // >>> [{\"a\":2,\"b\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?(@.a + @.b) * 2 == 10]\").await {\n            Ok(res9) => {\n                let res9: String = res9;\n                println!(\"{res9}\");    // >>> [{\"a\":2,\"b\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex83",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!([{\"a\":2,\"b\":3},{\"a\":5,\"b\":2}])) {\n            Ok(res9) => {\n                let res9: bool = res9;\n                println!(\"{}\", if res9 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?@.a + 1 == 3]\") {\n            Ok(res10) => {\n                let res10: String = res10;\n                println!(\"{res10}\");    // >>> [{\"a\":2,\"b\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?@.a + @.b * 2 == 8]\") {\n            Ok(res11) => {\n                let res11: String = res11;\n                println!(\"{res11}\");    // >>> [{\"a\":2,\"b\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?(@.a + @.b) * 2 == 10]\") {\n            Ok(res12) => {\n                let res12: String = res12;\n                println!(\"{res12}\");    // >>> [{\"a\":2,\"b\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex84",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":[1,2,3,4],\"allow\":[2,3]}'\nOK\n> JSON.GET doc '$.a[?@ in [2,4]]'\n\"[2,4]\"\n> JSON.GET doc '$.a[?@ nin [2,4]]'\n\"[1,3]\"\n> JSON.GET doc '$.a[?@ in $.allow]'\n\"[2,3]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex85",
      "language": "csharp",
      "code": "bool res13 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[1,2,3,4],\\\"allow\\\":[2,3]}\");\n        Console.WriteLine(res13);   // >>> True\n\n        RedisResult res14 = db.JSON().Get(\"doc\", path: \"$.a[?@ in [2,4]]\");\n        Console.WriteLine(res14);   // >>> [2,4]\n\n        RedisResult res15 = db.JSON().Get(\"doc\", path: \"$.a[?@ nin [2,4]]\");\n        Console.WriteLine(res15);   // >>> [1,3]\n\n        RedisResult res16 = db.JSON().Get(\"doc\", path: \"$.a[?@ in $.allow]\");\n        Console.WriteLine(res16);   // >>> [2,3]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex86",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[1,2,3,4],\"allow\":[2,3]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a[?@ in [2,4]]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [2,4]\n\n\tres3, err := rdb.JSONGet(ctx, \"doc\", `$.a[?@ nin [2,4]]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> [1,3]\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$.a[?@ in $.allow]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [2,3]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex87",
      "language": "java",
      "code": "CompletableFuture<Void> filterMembershipExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[1,2,3,4],\\\"allow\\\":[2,3]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ in [2,4]]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[2,4]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ nin [2,4]]\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> [[1,3]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ in $.allow]\"));\n                    }).thenAccept(res4 -> {\n                        System.out.println(res4); // >>> [[2,3]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex88",
      "language": "java",
      "code": "Mono<Void> filterMembershipExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":[1,2,3,4],\\\"allow\\\":[2,3]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ in [2,4]]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[2,4]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ nin [2,4]]\")).collectList())\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> [[1,3]]\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ in $.allow]\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[2,3]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex89",
      "language": "java",
      "code": "String res13 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[1,2,3,4],\\\"allow\\\":[2,3]}\");\n        System.out.println(res13);    // >>> OK\n\n        Object res14 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?@ in [2,4]]\"));\n        System.out.println(res14);    // >>> [2,4]\n\n        Object res15 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?@ nin [2,4]]\"));\n        System.out.println(res15);    // >>> [1,3]\n\n        Object res16 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?@ in $.allow]\"));\n        System.out.println(res16);    // >>> [2,3]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex90",
      "language": "javascript",
      "code": "const res13 = await client.json.set('doc', '$', { a: [1, 2, 3, 4], allow: [2, 3] });\nconsole.log(res13); // >>> OK\n\nconst res14 = await client.json.get('doc', { path: '$.a[?@ in [2,4]]' });\nconsole.log(res14); // >>> [ 2, 4 ]\n\nconst res15 = await client.json.get('doc', { path: '$.a[?@ nin [2,4]]' });\nconsole.log(res15); // >>> [ 1, 3 ]\n\nconst res16 = await client.json.get('doc', { path: '$.a[?@ in $.allow]' });\nconsole.log(res16); // >>> [ 2, 3 ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex91",
      "language": "php",
      "code": "$res13 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [1, 2, 3, 4], \"allow\" => [2, 3]]\n        ));\n        echo $res13 . PHP_EOL; // >>> OK\n\n        $res14 = $this->redis->jsonget('doc', '', '', '', '$.a[?@ in [2,4]]');\n        echo $res14 . PHP_EOL; // >>> [2,4]\n\n        $res15 = $this->redis->jsonget('doc', '', '', '', '$.a[?@ nin [2,4]]');\n        echo $res15 . PHP_EOL; // >>> [1,3]\n\n        $res16 = $this->redis->jsonget('doc', '', '', '', '$.a[?@ in $.allow]');\n        echo $res16 . PHP_EOL; // >>> [2,3]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex92",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": [1, 2, 3, 4], \"allow\": [2, 3]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.a[?@ in [2,4]]\")\nprint(res2)\n# >>> [2, 4]\n\nres3 = r.json().get(\"doc\", \"$.a[?@ nin [2,4]]\")\nprint(res3)\n# >>> [1, 3]\n\nres4 = r.json().get(\"doc\", \"$.a[?@ in $.allow]\")\nprint(res4)\n# >>> [2, 3]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex93",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => [1, 2, 3, 4], 'allow' => [2, 3] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a[?@ in [2,4]]')\np res2 # >>> [2, 4]\n\nres3 = r.json_get('doc', '$.a[?@ nin [2,4]]')\np res3 # >>> [1, 3]\n\nres4 = r.json_get('doc', '$.a[?@ in $.allow]')\np res4 # >>> [2, 3]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex94",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[1,2,3,4],\"allow\":[2,3]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?@ in [2,4]]\").await {\n            Ok(res10) => {\n                let res10: String = res10;\n                println!(\"{res10}\");    // >>> [2,4]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ nin [2,4]]\").await {\n            Ok(res11) => {\n                let res11: String = res11;\n                println!(\"{res11}\");    // >>> [1,3]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ in $.allow]\").await {\n            Ok(res12) => {\n                let res12: String = res12;\n                println!(\"{res12}\");    // >>> [2,3]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex95",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":[1,2,3,4],\"allow\":[2,3]})) {\n            Ok(res13) => {\n                let res13: bool = res13;\n                println!(\"{}\", if res13 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ in [2,4]]\") {\n            Ok(res14) => {\n                let res14: String = res14;\n                println!(\"{res14}\");    // >>> [2,4]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ nin [2,4]]\") {\n            Ok(res15) => {\n                let res15: String = res15;\n                println!(\"{res15}\");    // >>> [1,3]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ in $.allow]\") {\n            Ok(res16) => {\n                let res16: String = res16;\n                println!(\"{res16}\");    // >>> [2,3]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex96",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":[[1,2],[1,5],[]]}'\nOK\n> JSON.GET doc '$.a[?@ subsetof [1,2,3]]'\n\"[[1,2],[]]\"\n> JSON.SET doc $ '{\"a\":[[1,9],[8,9],[]]}'\nOK\n> JSON.GET doc '$.a[?@ anyof [1,2,3]]'\n\"[[1,9]]\"\n> JSON.SET doc $ '{\"a\":[[4,5],[1,9],[]]}'\nOK\n> JSON.GET doc '$.a[?@ noneof [1,2,3]]'\n\"[[4,5],[]]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex97",
      "language": "csharp",
      "code": "bool res17 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[[1,2],[1,5],[]]}\");\n        Console.WriteLine(res17);   // >>> True\n\n        RedisResult res18 = db.JSON().Get(\"doc\", path: \"$.a[?@ subsetof [1,2,3]]\");\n        Console.WriteLine(res18);   // >>> [[1,2],[]]\n\n        bool res19 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[[1,9],[8,9],[]]}\");\n        Console.WriteLine(res19);   // >>> True\n\n        RedisResult res20 = db.JSON().Get(\"doc\", path: \"$.a[?@ anyof [1,2,3]]\");\n        Console.WriteLine(res20);   // >>> [[1,9]]\n\n        bool res21 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[[4,5],[1,9],[]]}\");\n        Console.WriteLine(res21);   // >>> True\n\n        RedisResult res22 = db.JSON().Get(\"doc\", path: \"$.a[?@ noneof [1,2,3]]\");\n        Console.WriteLine(res22);   // >>> [[4,5],[]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex98",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[[1,2],[1,5],[]]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a[?@ subsetof [1,2,3]]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [[1,2],[]]\n\n\tres3, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[[1,9],[8,9],[]]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> OK\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$.a[?@ anyof [1,2,3]]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [[1,9]]\n\n\tres5, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[[4,5],[1,9],[]]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res5) // >>> OK\n\n\tres6, err := rdb.JSONGet(ctx, \"doc\", `$.a[?@ noneof [1,2,3]]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res6) // >>> [[4,5],[]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex99",
      "language": "java",
      "code": "CompletableFuture<Void> filterSetRelationsExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":[[1,2],[1,5],[]]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ subsetof [1,2,3]]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[[1,2],[]]]\n                        return asyncCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                                parser.createJsonValue(\"{\\\"a\\\":[[1,9],[8,9],[]]}\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ anyof [1,2,3]]\"));\n                    }).thenCompose(res4 -> {\n                        System.out.println(res4); // >>> [[[1,9]]]\n                        return asyncCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                                parser.createJsonValue(\"{\\\"a\\\":[[4,5],[1,9],[]]}\"));\n                    }).thenCompose(res5 -> {\n                        System.out.println(res5); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ noneof [1,2,3]]\"));\n                    }).thenAccept(res6 -> {\n                        System.out.println(res6); // >>> [[[4,5],[]]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex100",
      "language": "java",
      "code": "Mono<Void> filterSetRelationsExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":[[1,2],[1,5],[]]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ subsetof [1,2,3]]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[[1,2],[]]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[[1,9],[8,9],[]]}\")))\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> OK\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ anyof [1,2,3]]\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[[1,9]]]\n                    })\n                    .flatMap(res4 -> reactiveCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[[4,5],[1,9],[]]}\")))\n                    .doOnNext(res5 -> {\n                        System.out.println(res5); // >>> OK\n                    })\n                    .flatMap(res5 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ noneof [1,2,3]]\")).collectList())\n                    .doOnNext(res6 -> {\n                        System.out.println(res6); // >>> [[[4,5],[]]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex101",
      "language": "java",
      "code": "String res17 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[[1,2],[1,5],[]]}\");\n        System.out.println(res17);    // >>> OK\n\n        Object res18 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?@ subsetof [1,2,3]]\"));\n        System.out.println(res18);    // >>> [[1,2],[]]\n\n        String res19 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[[1,9],[8,9],[]]}\");\n        System.out.println(res19);    // >>> OK\n\n        Object res20 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?@ anyof [1,2,3]]\"));\n        System.out.println(res20);    // >>> [[1,9]]\n\n        String res21 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[[4,5],[1,9],[]]}\");\n        System.out.println(res21);    // >>> OK\n\n        Object res22 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?@ noneof [1,2,3]]\"));\n        System.out.println(res22);    // >>> [[4,5],[]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex102",
      "language": "javascript",
      "code": "const res17 = await client.json.set('doc', '$', { a: [[1, 2], [1, 5], []] });\nconsole.log(res17); // >>> OK\n\nconst res18 = await client.json.get('doc', { path: '$.a[?@ subsetof [1,2,3]]' });\nconsole.log(res18); // >>> [ [ 1, 2 ], [] ]\n\nconst res19 = await client.json.set('doc', '$', { a: [[1, 9], [8, 9], []] });\nconsole.log(res19); // >>> OK\n\nconst res20 = await client.json.get('doc', { path: '$.a[?@ anyof [1,2,3]]' });\nconsole.log(res20); // >>> [ [ 1, 9 ] ]\n\nconst res21 = await client.json.set('doc', '$', { a: [[4, 5], [1, 9], []] });\nconsole.log(res21); // >>> OK\n\nconst res22 = await client.json.get('doc', { path: '$.a[?@ noneof [1,2,3]]' });\nconsole.log(res22); // >>> [ [ 4, 5 ], [] ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex103",
      "language": "php",
      "code": "$res17 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[1, 2], [1, 5], []]]\n        ));\n        echo $res17 . PHP_EOL; // >>> OK\n\n        $res18 = $this->redis->jsonget('doc', '', '', '', '$.a[?@ subsetof [1,2,3]]');\n        echo $res18 . PHP_EOL; // >>> [[1,2],[]]\n\n        $res19 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[1, 9], [8, 9], []]]\n        ));\n        echo $res19 . PHP_EOL; // >>> OK\n\n        $res20 = $this->redis->jsonget('doc', '', '', '', '$.a[?@ anyof [1,2,3]]');\n        echo $res20 . PHP_EOL; // >>> [[1,9]]\n\n        $res21 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[4, 5], [1, 9], []]]\n        ));\n        echo $res21 . PHP_EOL; // >>> OK\n\n        $res22 = $this->redis->jsonget('doc', '', '', '', '$.a[?@ noneof [1,2,3]]');\n        echo $res22 . PHP_EOL; // >>> [[4,5],[]]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex104",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": [[1, 2], [1, 5], []]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.a[?@ subsetof [1,2,3]]\")\nprint(res2)\n# >>> [[1, 2], []]\n\nres3 = r.json().set(\"doc\", \"$\", {\"a\": [[1, 9], [8, 9], []]})\nprint(res3)\n# >>> True\n\nres4 = r.json().get(\"doc\", \"$.a[?@ anyof [1,2,3]]\")\nprint(res4)\n# >>> [[1, 9]]\n\nres5 = r.json().set(\"doc\", \"$\", {\"a\": [[4, 5], [1, 9], []]})\nprint(res5)\n# >>> True\n\nres6 = r.json().get(\"doc\", \"$.a[?@ noneof [1,2,3]]\")\nprint(res6)\n# >>> [[4, 5], []]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex105",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => [[1, 2], [1, 5], []] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a[?@ subsetof [1,2,3]]')\np res2 # >>> [[1, 2], []]\n\nres3 = r.json_set('doc', '$', { 'a' => [[1, 9], [8, 9], []] })\nputs res3 # >>> OK\n\nres4 = r.json_get('doc', '$.a[?@ anyof [1,2,3]]')\np res4 # >>> [[1, 9]]\n\nres5 = r.json_set('doc', '$', { 'a' => [[4, 5], [1, 9], []] })\nputs res5 # >>> OK\n\nres6 = r.json_get('doc', '$.a[?@ noneof [1,2,3]]')\np res6 # >>> [[4, 5], []]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex106",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[[1,2],[1,5],[]]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?@ subsetof [1,2,3]]\").await {\n            Ok(res13) => {\n                let res13: String = res13;\n                println!(\"{res13}\");    // >>> [[1,2],[]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[[1,9],[8,9],[]]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?@ anyof [1,2,3]]\").await {\n            Ok(res14) => {\n                let res14: String = res14;\n                println!(\"{res14}\");    // >>> [[1,9]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[[4,5],[1,9],[]]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?@ noneof [1,2,3]]\").await {\n            Ok(res15) => {\n                let res15: String = res15;\n                println!(\"{res15}\");    // >>> [[4,5],[]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex107",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":[[1,2],[1,5],[]]})) {\n            Ok(res17) => {\n                let res17: bool = res17;\n                println!(\"{}\", if res17 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ subsetof [1,2,3]]\") {\n            Ok(res18) => {\n                let res18: String = res18;\n                println!(\"{res18}\");    // >>> [[1,2],[]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_set(\"doc\", \"$\", &json!({\"a\":[[1,9],[8,9],[]]})) {\n            Ok(res19) => {\n                let res19: bool = res19;\n                println!(\"{}\", if res19 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ anyof [1,2,3]]\") {\n            Ok(res20) => {\n                let res20: String = res20;\n                println!(\"{res20}\");    // >>> [[1,9]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_set(\"doc\", \"$\", &json!({\"a\":[[4,5],[1,9],[]]})) {\n            Ok(res21) => {\n                let res21: bool = res21;\n                println!(\"{}\", if res21 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ noneof [1,2,3]]\") {\n            Ok(res22) => {\n                let res22: String = res22;\n                println!(\"{res22}\");    // >>> [[4,5],[]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex108",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":[[4,5],[1],[7,8,9]]}'\nOK\n> JSON.GET doc '$.a[?@ sizeof 2]'\n\"[[4,5]]\"\n> JSON.SET doc $ '{\"a\":[[],[1],\"\",[2,3],{},{\"k\":1}]}'\nOK\n> JSON.GET doc '$.a[?@ empty true]'\n\"[[],\\\"\\\",{}]\"\n> JSON.GET doc '$.a[?@ empty false]'\n\"[[1],[2,3],{\\\"k\\\":1}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex109",
      "language": "csharp",
      "code": "bool res23 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[[4,5],[1],[7,8,9]]}\");\n        Console.WriteLine(res23);   // >>> True\n\n        RedisResult res24 = db.JSON().Get(\"doc\", path: \"$.a[?@ sizeof 2]\");\n        Console.WriteLine(res24);   // >>> [[4,5]]\n\n        bool res25 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[[],[1],\\\"\\\",[2,3],{},{\\\"k\\\":1}]}\");\n        Console.WriteLine(res25);   // >>> True\n\n        RedisResult res26 = db.JSON().Get(\"doc\", path: \"$.a[?@ empty true]\");\n        Console.WriteLine(res26);   // >>> [[],\"\",{}]\n\n        RedisResult res27 = db.JSON().Get(\"doc\", path: \"$.a[?@ empty false]\");\n        Console.WriteLine(res27);   // >>> [[1],[2,3],{\"k\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex110",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[[4,5],[1],[7,8,9]]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a[?@ sizeof 2]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [[4,5]]\n\n\tres3, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[[],[1],\"\",[2,3],{},{\"k\":1}]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> OK\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$.a[?@ empty true]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [[],\"\",{}]\n\n\tres5, err := rdb.JSONGet(ctx, \"doc\", `$.a[?@ empty false]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res5) // >>> [[1],[2,3],{\"k\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex111",
      "language": "java",
      "code": "CompletableFuture<Void> filterSizeEmptyExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":[[4,5],[1],[7,8,9]]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ sizeof 2]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[[4,5]]]\n                        return asyncCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                                parser.createJsonValue(\"{\\\"a\\\":[[],[1],\\\"\\\",[2,3],{},{\\\"k\\\":1}]}\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ empty true]\"));\n                    }).thenCompose(res4 -> {\n                        System.out.println(res4); // >>> [[[],\"\",{}]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ empty false]\"));\n                    }).thenAccept(res5 -> {\n                        System.out.println(res5); // >>> [[[1],[2,3],{\"k\":1}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex112",
      "language": "java",
      "code": "Mono<Void> filterSizeEmptyExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":[[4,5],[1],[7,8,9]]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ sizeof 2]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[[4,5]]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[[],[1],\\\"\\\",[2,3],{},{\\\"k\\\":1}]}\")))\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> OK\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ empty true]\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[[],\"\",{}]]\n                    })\n                    .flatMap(res4 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?@ empty false]\")).collectList())\n                    .doOnNext(res5 -> {\n                        System.out.println(res5); // >>> [[[1],[2,3],{\"k\":1}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex113",
      "language": "java",
      "code": "String res23 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[[4,5],[1],[7,8,9]]}\");\n        System.out.println(res23);    // >>> OK\n\n        Object res24 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?@ sizeof 2]\"));\n        System.out.println(res24);    // >>> [[4,5]]\n\n        String res25 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[[],[1],\\\"\\\",[2,3],{},{\\\"k\\\":1}]}\");\n        System.out.println(res25);    // >>> OK\n\n        Object res26 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?@ empty true]\"));\n        System.out.println(res26);    // >>> [[],\"\",{}]\n\n        Object res27 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?@ empty false]\"));\n        System.out.println(res27);    // >>> [[1],[2,3],{\"k\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex114",
      "language": "javascript",
      "code": "const res23 = await client.json.set('doc', '$', { a: [[4, 5], [1], [7, 8, 9]] });\nconsole.log(res23); // >>> OK\n\nconst res24 = await client.json.get('doc', { path: '$.a[?@ sizeof 2]' });\nconsole.log(res24); // >>> [ [ 4, 5 ] ]\n\nconst res25 = await client.json.set('doc', '$', { a: [[], [1], '', [2, 3], {}, { k: 1 }] });\nconsole.log(res25); // >>> OK\n\nconst res26 = await client.json.get('doc', { path: '$.a[?@ empty true]' });\nconsole.log(res26); // >>> [ [], '', {} ]\n\nconst res27 = await client.json.get('doc', { path: '$.a[?@ empty false]' });\nconsole.log(res27); // >>> [ [ 1 ], [ 2, 3 ], { k: 1 } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex115",
      "language": "php",
      "code": "$res23 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[4, 5], [1], [7, 8, 9]]]\n        ));\n        echo $res23 . PHP_EOL; // >>> OK\n\n        $res24 = $this->redis->jsonget('doc', '', '', '', '$.a[?@ sizeof 2]');\n        echo $res24 . PHP_EOL; // >>> [[4,5]]\n\n        $res25 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[], [1], \"\", [2, 3], new \\stdClass(), [\"k\" => 1]]]\n        ));\n        echo $res25 . PHP_EOL; // >>> OK\n\n        $res26 = $this->redis->jsonget('doc', '', '', '', '$.a[?@ empty true]');\n        echo $res26 . PHP_EOL; // >>> [[],\"\",{}]\n\n        $res27 = $this->redis->jsonget('doc', '', '', '', '$.a[?@ empty false]');\n        echo $res27 . PHP_EOL; // >>> [[1],[2,3],{\"k\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex116",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": [[4, 5], [1], [7, 8, 9]]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.a[?@ sizeof 2]\")\nprint(res2)\n# >>> [[4, 5]]\n\nres3 = r.json().set(\"doc\", \"$\", {\"a\": [[], [1], \"\", [2, 3], {}, {\"k\": 1}]})\nprint(res3)\n# >>> True\n\nres4 = r.json().get(\"doc\", \"$.a[?@ empty true]\")\nprint(res4)\n# >>> [[], '', {}]\n\nres5 = r.json().get(\"doc\", \"$.a[?@ empty false]\")\nprint(res5)\n# >>> [[1], [2, 3], {'k': 1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex117",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => [[4, 5], [1], [7, 8, 9]] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a[?@ sizeof 2]')\np res2 # >>> [[4, 5]]\n\nres3 = r.json_set('doc', '$', { 'a' => [[], [1], '', [2, 3], {}, { 'k' => 1 }] })\nputs res3 # >>> OK\n\nres4 = r.json_get('doc', '$.a[?@ empty true]')\np res4 # >>> [[], \"\", {}]\n\nres5 = r.json_get('doc', '$.a[?@ empty false]')\np res5 # >>> [[1], [2, 3], {\"k\"=>1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex118",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[[4,5],[1],[7,8,9]]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?@ sizeof 2]\").await {\n            Ok(res16) => {\n                let res16: String = res16;\n                println!(\"{res16}\");    // >>> [[4,5]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[[],[1],\"\",[2,3],{},{\"k\":1}]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?@ empty true]\").await {\n            Ok(res17) => {\n                let res17: String = res17;\n                println!(\"{res17}\");    // >>> [[],\"\",{}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ empty false]\").await {\n            Ok(res18) => {\n                let res18: String = res18;\n                println!(\"{res18}\");    // >>> [[1],[2,3],{\"k\":1}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex119",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":[[4,5],[1],[7,8,9]]})) {\n            Ok(res23) => {\n                let res23: bool = res23;\n                println!(\"{}\", if res23 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ sizeof 2]\") {\n            Ok(res24) => {\n                let res24: String = res24;\n                println!(\"{res24}\");    // >>> [[4,5]]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_set(\"doc\", \"$\", &json!({\"a\":[[],[1],\"\",[2,3],{},{\"k\":1}]})) {\n            Ok(res25) => {\n                let res25: bool = res25;\n                println!(\"{}\", if res25 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ empty true]\") {\n            Ok(res26) => {\n                let res26: String = res26;\n                println!(\"{res26}\");    // >>> [[],\"\",{}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?@ empty false]\") {\n            Ok(res27) => {\n                let res27: String = res27;\n                println!(\"{res27}\");    // >>> [[1],[2,3],{\"k\":1}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex120",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"obj\":{\"x\":1,\"y\":2},\"books\":[{\"t\":\"a\"},{\"t\":\"b\"}]}'\nOK\n> JSON.GET doc '$.obj~'\n\"[\\\"x\\\",\\\"y\\\"]\"\n> JSON.GET doc '$~'\n\"[\\\"obj\\\",\\\"books\\\"]\"\n> JSON.GET doc '$.books~'\n\"[]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex121",
      "language": "csharp",
      "code": "bool res28 = db.JSON().Set(\n            \"doc\",\n            \"$\",\n            \"{\\\"obj\\\":{\\\"x\\\":1,\\\"y\\\":2},\\\"books\\\":[{\\\"t\\\":\\\"a\\\"},{\\\"t\\\":\\\"b\\\"}]}\"\n        );\n        Console.WriteLine(res28);   // >>> True\n\n        RedisResult res29 = db.JSON().Get(\"doc\", path: \"$.obj~\");\n        Console.WriteLine(res29);   // >>> [\"x\",\"y\"]\n\n        RedisResult res30 = db.JSON().Get(\"doc\", path: \"$~\");\n        Console.WriteLine(res30);   // >>> [\"obj\",\"books\"]\n\n        RedisResult res31 = db.JSON().Get(\"doc\", path: \"$.books~\");\n        Console.WriteLine(res31);   // >>> []",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex122",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"obj\":{\"x\":1,\"y\":2},\"books\":[{\"t\":\"a\"},{\"t\":\"b\"}]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.obj~`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [\"x\",\"y\"]\n\n\tres3, err := rdb.JSONGet(ctx, \"doc\", `$~`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> [\"obj\",\"books\"]\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$.books~`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> []",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex123",
      "language": "java",
      "code": "CompletableFuture<Void> filterGetkeysExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\n                                    \"{\\\"obj\\\":{\\\"x\\\":1,\\\"y\\\":2},\\\"books\\\":[{\\\"t\\\":\\\"a\\\"},{\\\"t\\\":\\\"b\\\"}]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.obj~\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[\"x\",\"y\"]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$~\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> [[\"obj\",\"books\"]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.books~\"));\n                    }).thenAccept(res4 -> {\n                        System.out.println(res4); // >>> [[]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex124",
      "language": "java",
      "code": "Mono<Void> filterGetkeysExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"obj\\\":{\\\"x\\\":1,\\\"y\\\":2},\\\"books\\\":[{\\\"t\\\":\\\"a\\\"},{\\\"t\\\":\\\"b\\\"}]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.obj~\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[\"x\",\"y\"]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$~\")).collectList())\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> [[\"obj\",\"books\"]]\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.books~\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex125",
      "language": "java",
      "code": "String res28 = jedis.jsonSet(\n            \"doc\",\n            new Path2(\"$\"),\n            \"{\\\"obj\\\":{\\\"x\\\":1,\\\"y\\\":2},\\\"books\\\":[{\\\"t\\\":\\\"a\\\"},{\\\"t\\\":\\\"b\\\"}]}\"\n        );\n        System.out.println(res28);    // >>> OK\n\n        Object res29 = jedis.jsonGet(\"doc\", new Path2(\"$.obj~\"));\n        System.out.println(res29);    // >>> [\"x\",\"y\"]\n\n        Object res30 = jedis.jsonGet(\"doc\", new Path2(\"$~\"));\n        System.out.println(res30);    // >>> [\"obj\",\"books\"]\n\n        Object res31 = jedis.jsonGet(\"doc\", new Path2(\"$.books~\"));\n        System.out.println(res31);    // >>> []",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex126",
      "language": "javascript",
      "code": "const res28 = await client.json.set('doc', '$', {\n  obj: { x: 1, y: 2 },\n  books: [{ t: 'a' }, { t: 'b' }]\n});\nconsole.log(res28); // >>> OK\n\nconst res29 = await client.json.get('doc', { path: '$.obj~' });\nconsole.log(res29); // >>> [ 'x', 'y' ]\n\nconst res30 = await client.json.get('doc', { path: '$~' });\nconsole.log(res30); // >>> [ 'obj', 'books' ]\n\nconst res31 = await client.json.get('doc', { path: '$.books~' });\nconsole.log(res31); // >>> []",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex127",
      "language": "php",
      "code": "$res28 = $this->redis->jsonset('doc', '$', json_encode([\n            \"obj\" => [\"x\" => 1, \"y\" => 2],\n            \"books\" => [[\"t\" => \"a\"], [\"t\" => \"b\"]],\n        ]));\n        echo $res28 . PHP_EOL; // >>> OK\n\n        $res29 = $this->redis->jsonget('doc', '', '', '', '$.obj~');\n        echo $res29 . PHP_EOL; // >>> [\"x\",\"y\"]\n\n        $res30 = $this->redis->jsonget('doc', '', '', '', '$~');\n        echo $res30 . PHP_EOL; // >>> [\"obj\",\"books\"]\n\n        $res31 = $this->redis->jsonget('doc', '', '', '', '$.books~');\n        echo $res31 . PHP_EOL; // >>> []",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex128",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"obj\": {\"x\": 1, \"y\": 2}, \"books\": [{\"t\": \"a\"}, {\"t\": \"b\"}]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.obj~\")\nprint(res2)\n# >>> ['x', 'y']\n\nres3 = r.json().get(\"doc\", \"$~\")\nprint(res3)\n# >>> ['obj', 'books']\n\nres4 = r.json().get(\"doc\", \"$.books~\")\nprint(res4)\n# >>> []",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex129",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'obj' => { 'x' => 1, 'y' => 2 }, 'books' => [{ 't' => 'a' }, { 't' => 'b' }] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.obj~')\np res2 # >>> [\"x\", \"y\"]\n\nres3 = r.json_get('doc', '$~')\np res3 # >>> [\"obj\", \"books\"]\n\nres4 = r.json_get('doc', '$.books~')\np res4 # >>> []",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex130",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\n            \"doc\",\n            \"$\",\n            &json!({\"obj\":{\"x\":1,\"y\":2},\"books\":[{\"t\":\"a\"},{\"t\":\"b\"}]}),\n        ).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.obj~\").await {\n            Ok(res19) => {\n                let res19: String = res19;\n                println!(\"{res19}\");    // >>> [\"x\",\"y\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$~\").await {\n            Ok(res20) => {\n                let res20: String = res20;\n                println!(\"{res20}\");    // >>> [\"obj\",\"books\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.books~\").await {\n            Ok(res21) => {\n                let res21: String = res21;\n                println!(\"{res21}\");    // >>> []\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex131",
      "language": "rust",
      "code": "match r.json_set(\n            \"doc\",\n            \"$\",\n            &json!({\"obj\":{\"x\":1,\"y\":2},\"books\":[{\"t\":\"a\"},{\"t\":\"b\"}]}),\n        ) {\n            Ok(res28) => {\n                let res28: bool = res28;\n                println!(\"{}\", if res28 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.obj~\") {\n            Ok(res29) => {\n                let res29: String = res29;\n                println!(\"{res29}\");    // >>> [\"x\",\"y\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$~\") {\n            Ok(res30) => {\n                let res30: String = res30;\n                println!(\"{res30}\");    // >>> [\"obj\",\"books\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.books~\") {\n            Ok(res31) => {\n                let res31: String = res31;\n                println!(\"{res31}\");    // >>> []\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex132",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":[[1,2,3],[1],\"abcd\",\"x\"]}'\nOK\n> JSON.GET doc '$.a[?length(@) > 2]'\n\"[[1,2,3],\\\"abcd\\\"]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex133",
      "language": "csharp",
      "code": "bool res32 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[[1,2,3],[1],\\\"abcd\\\",\\\"x\\\"]}\");\n        Console.WriteLine(res32);   // >>> True\n\n        RedisResult res33 = db.JSON().Get(\"doc\", path: \"$.a[?length(@) > 2]\");\n        Console.WriteLine(res33);   // >>> [[1,2,3],\"abcd\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex134",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[[1,2,3],[1],\"abcd\",\"x\"]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a[?length(@) > 2]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [[1,2,3],\"abcd\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex135",
      "language": "java",
      "code": "CompletableFuture<Void> funcLengthExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[[1,2,3],[1],\\\"abcd\\\",\\\"x\\\"]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?length(@) > 2]\"));\n                    }).thenAccept(res2 -> {\n                        System.out.println(res2); // >>> [[[1,2,3],\"abcd\"]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex136",
      "language": "java",
      "code": "Mono<Void> funcLengthExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[[1,2,3],[1],\\\"abcd\\\",\\\"x\\\"]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?length(@) > 2]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[[1,2,3],\"abcd\"]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex137",
      "language": "java",
      "code": "String res32 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[[1,2,3],[1],\\\"abcd\\\",\\\"x\\\"]}\");\n        System.out.println(res32);    // >>> OK\n\n        Object res33 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?length(@) > 2]\"));\n        System.out.println(res33);    // >>> [[1,2,3],\"abcd\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex138",
      "language": "javascript",
      "code": "const res32 = await client.json.set('doc', '$', { a: [[1, 2, 3], [1], 'abcd', 'x'] });\nconsole.log(res32); // >>> OK\n\nconst res33 = await client.json.get('doc', { path: '$.a[?length(@) > 2]' });\nconsole.log(res33); // >>> [ [ 1, 2, 3 ], 'abcd' ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex139",
      "language": "php",
      "code": "$res32 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[1, 2, 3], [1], \"abcd\", \"x\"]]\n        ));\n        echo $res32 . PHP_EOL; // >>> OK\n\n        $res33 = $this->redis->jsonget('doc', '', '', '', '$.a[?length(@) > 2]');\n        echo $res33 . PHP_EOL; // >>> [[1,2,3],\"abcd\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex140",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": [[1, 2, 3], [1], \"abcd\", \"x\"]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.a[?length(@) > 2]\")\nprint(res2)\n# >>> [[1, 2, 3], 'abcd']",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex141",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => [[1, 2, 3], [1], 'abcd', 'x'] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a[?length(@) > 2]')\np res2 # >>> [[1, 2, 3], \"abcd\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex142",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[[1,2,3],[1],\"abcd\",\"x\"]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?length(@) > 2]\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [[1,2,3],\"abcd\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex143",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":[[1,2,3],[1],\"abcd\",\"x\"]})) {\n            Ok(res32) => {\n                let res32: bool = res32;\n                println!(\"{}\", if res32 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?length(@) > 2]\") {\n            Ok(res33) => {\n                let res33: String = res33;\n                println!(\"{res33}\");    // >>> [[1,2,3],\"abcd\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex144",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '[{\"a\":1,\"b\":2,\"c\":3},{\"a\":1}]'\nOK\n> JSON.GET doc '$[?count(@.*) == 3]'\n\"[{\\\"a\\\":1,\\\"b\\\":2,\\\"c\\\":3}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex145",
      "language": "csharp",
      "code": "bool res34 = db.JSON().Set(\"doc\", \"$\", \"[{\\\"a\\\":1,\\\"b\\\":2,\\\"c\\\":3},{\\\"a\\\":1}]\");\n        Console.WriteLine(res34);   // >>> True\n\n        RedisResult res35 = db.JSON().Get(\"doc\", path: \"$[?count(@.*) == 3]\");\n        Console.WriteLine(res35);   // >>> [{\"a\":1,\"b\":2,\"c\":3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex146",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`[{\"a\":1,\"b\":2,\"c\":3},{\"a\":1}]`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$[?count(@.*) == 3]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [{\"a\":1,\"b\":2,\"c\":3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex147",
      "language": "java",
      "code": "CompletableFuture<Void> funcCountExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"[{\\\"a\\\":1,\\\"b\\\":2,\\\"c\\\":3},{\\\"a\\\":1}]\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$[?count(@.*) == 3]\"));\n                    }).thenAccept(res2 -> {\n                        System.out.println(res2); // >>> [[{\"a\":1,\"b\":2,\"c\":3}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex148",
      "language": "java",
      "code": "Mono<Void> funcCountExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"[{\\\"a\\\":1,\\\"b\\\":2,\\\"c\\\":3},{\\\"a\\\":1}]\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$[?count(@.*) == 3]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[{\"a\":1,\"b\":2,\"c\":3}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex149",
      "language": "java",
      "code": "String res34 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"[{\\\"a\\\":1,\\\"b\\\":2,\\\"c\\\":3},{\\\"a\\\":1}]\");\n        System.out.println(res34);    // >>> OK\n\n        Object res35 = jedis.jsonGet(\"doc\", new Path2(\"$[?count(@.*) == 3]\"));\n        System.out.println(res35);    // >>> [{\"a\":1,\"b\":2,\"c\":3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex150",
      "language": "javascript",
      "code": "const res34 = await client.json.set('doc', '$', [{ a: 1, b: 2, c: 3 }, { a: 1 }]);\nconsole.log(res34); // >>> OK\n\nconst res35 = await client.json.get('doc', { path: '$[?count(@.*) == 3]' });\nconsole.log(res35); // >>> [ { a: 1, b: 2, c: 3 } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex151",
      "language": "php",
      "code": "$res34 = $this->redis->jsonset('doc', '$', json_encode(\n            [[\"a\" => 1, \"b\" => 2, \"c\" => 3], [\"a\" => 1]]\n        ));\n        echo $res34 . PHP_EOL; // >>> OK\n\n        $res35 = $this->redis->jsonget('doc', '', '', '', '$[?count(@.*) == 3]');\n        echo $res35 . PHP_EOL; // >>> [{\"a\":1,\"b\":2,\"c\":3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex152",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", [{\"a\": 1, \"b\": 2, \"c\": 3}, {\"a\": 1}])\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$[?count(@.*) == 3]\")\nprint(res2)\n# >>> [{'a': 1, 'b': 2, 'c': 3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex153",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', [{ 'a' => 1, 'b' => 2, 'c' => 3 }, { 'a' => 1 }])\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$[?count(@.*) == 3]')\np res2 # >>> [{\"a\"=>1, \"b\"=>2, \"c\"=>3}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex154",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!([{\"a\":1,\"b\":2,\"c\":3},{\"a\":1}])).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$[?count(@.*) == 3]\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [{\"a\":1,\"b\":2,\"c\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex155",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!([{\"a\":1,\"b\":2,\"c\":3},{\"a\":1}])) {\n            Ok(res34) => {\n                let res34: bool = res34;\n                println!(\"{}\", if res34 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?count(@.*) == 3]\") {\n            Ok(res35) => {\n                let res35: String = res35;\n                println!(\"{res35}\");    // >>> [{\"a\":1,\"b\":2,\"c\":3}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex156",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '[{\"a\":1},{\"a\":2}]'\nOK\n> JSON.GET doc '$[?value(@.a) == 1]'\n\"[{\\\"a\\\":1}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex157",
      "language": "csharp",
      "code": "bool res36 = db.JSON().Set(\"doc\", \"$\", \"[{\\\"a\\\":1},{\\\"a\\\":2}]\");\n        Console.WriteLine(res36);   // >>> True\n\n        RedisResult res37 = db.JSON().Get(\"doc\", path: \"$[?value(@.a) == 1]\");\n        Console.WriteLine(res37);   // >>> [{\"a\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex158",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`[{\"a\":1},{\"a\":2}]`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$[?value(@.a) == 1]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [{\"a\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex159",
      "language": "java",
      "code": "CompletableFuture<Void> funcValueExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"[{\\\"a\\\":1},{\\\"a\\\":2}]\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$[?value(@.a) == 1]\"));\n                    }).thenAccept(res2 -> {\n                        System.out.println(res2); // >>> [[{\"a\":1}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex160",
      "language": "java",
      "code": "Mono<Void> funcValueExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"[{\\\"a\\\":1},{\\\"a\\\":2}]\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$[?value(@.a) == 1]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[{\"a\":1}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex161",
      "language": "java",
      "code": "String res36 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"[{\\\"a\\\":1},{\\\"a\\\":2}]\");\n        System.out.println(res36);    // >>> OK\n\n        Object res37 = jedis.jsonGet(\"doc\", new Path2(\"$[?value(@.a) == 1]\"));\n        System.out.println(res37);    // >>> [{\"a\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex162",
      "language": "javascript",
      "code": "const res36 = await client.json.set('doc', '$', [{ a: 1 }, { a: 2 }]);\nconsole.log(res36); // >>> OK\n\nconst res37 = await client.json.get('doc', { path: '$[?value(@.a) == 1]' });\nconsole.log(res37); // >>> [ { a: 1 } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex163",
      "language": "php",
      "code": "$res36 = $this->redis->jsonset('doc', '$', json_encode(\n            [[\"a\" => 1], [\"a\" => 2]]\n        ));\n        echo $res36 . PHP_EOL; // >>> OK\n\n        $res37 = $this->redis->jsonget('doc', '', '', '', '$[?value(@.a) == 1]');\n        echo $res37 . PHP_EOL; // >>> [{\"a\":1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex164",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", [{\"a\": 1}, {\"a\": 2}])\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$[?value(@.a) == 1]\")\nprint(res2)\n# >>> [{'a': 1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex165",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', [{ 'a' => 1 }, { 'a' => 2 }])\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$[?value(@.a) == 1]')\np res2 # >>> [{\"a\"=>1}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex166",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!([{\"a\":1},{\"a\":2}])).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$[?value(@.a) == 1]\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [{\"a\":1}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex167",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!([{\"a\":1},{\"a\":2}])) {\n            Ok(res36) => {\n                let res36: bool = res36;\n                println!(\"{}\", if res36 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$[?value(@.a) == 1]\") {\n            Ok(res37) => {\n                let res37: String = res37;\n                println!(\"{res37}\");    // >>> [{\"a\":1}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex168",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"obj\":{\"x\":1,\"y\":2}}'\nOK\n> JSON.GET doc '$.obj.keys()'\n\"[\\\"x\\\",\\\"y\\\"]\"\n> JSON.GET doc '$.obj.keys().count()'\n\"[2]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex169",
      "language": "csharp",
      "code": "bool res38 = db.JSON().Set(\"doc\", \"$\", \"{\\\"obj\\\":{\\\"x\\\":1,\\\"y\\\":2}}\");\n        Console.WriteLine(res38);   // >>> True\n\n        RedisResult res39 = db.JSON().Get(\"doc\", path: \"$.obj.keys()\");\n        Console.WriteLine(res39);   // >>> [\"x\",\"y\"]\n\n        RedisResult res40 = db.JSON().Get(\"doc\", path: \"$.obj.keys().count()\");\n        Console.WriteLine(res40);   // >>> [2]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex170",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"obj\":{\"x\":1,\"y\":2}}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.obj.keys()`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [\"x\",\"y\"]\n\n\tres3, err := rdb.JSONGet(ctx, \"doc\", `$.obj.keys().count()`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> [2]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex171",
      "language": "java",
      "code": "CompletableFuture<Void> funcKeysExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"obj\\\":{\\\"x\\\":1,\\\"y\\\":2}}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.obj.keys()\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[\"x\",\"y\"]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.obj.keys().count()\"));\n                    }).thenAccept(res3 -> {\n                        System.out.println(res3); // >>> [[2]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex172",
      "language": "java",
      "code": "Mono<Void> funcKeysExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"obj\\\":{\\\"x\\\":1,\\\"y\\\":2}}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.obj.keys()\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[\"x\",\"y\"]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.obj.keys().count()\")).collectList())\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> [[2]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex173",
      "language": "java",
      "code": "String res38 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"obj\\\":{\\\"x\\\":1,\\\"y\\\":2}}\");\n        System.out.println(res38);    // >>> OK\n\n        Object res39 = jedis.jsonGet(\"doc\", new Path2(\"$.obj.keys()\"));\n        System.out.println(res39);    // >>> [\"x\",\"y\"]\n\n        Object res40 = jedis.jsonGet(\"doc\", new Path2(\"$.obj.keys().count()\"));\n        System.out.println(res40);    // >>> [2]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex174",
      "language": "javascript",
      "code": "const res38 = await client.json.set('doc', '$', { obj: { x: 1, y: 2 } });\nconsole.log(res38); // >>> OK\n\nconst res39 = await client.json.get('doc', { path: '$.obj.keys()' });\nconsole.log(res39); // >>> [ 'x', 'y' ]\n\nconst res40 = await client.json.get('doc', { path: '$.obj.keys().count()' });\nconsole.log(res40); // >>> [ 2 ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex175",
      "language": "php",
      "code": "$res38 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"obj\" => [\"x\" => 1, \"y\" => 2]]\n        ));\n        echo $res38 . PHP_EOL; // >>> OK\n\n        $res39 = $this->redis->jsonget('doc', '', '', '', '$.obj.keys()');\n        echo $res39 . PHP_EOL; // >>> [\"x\",\"y\"]\n\n        $res40 = $this->redis->jsonget('doc', '', '', '', '$.obj.keys().count()');\n        echo $res40 . PHP_EOL; // >>> [2]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex176",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"obj\": {\"x\": 1, \"y\": 2}})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.obj.keys()\")\nprint(res2)\n# >>> ['x', 'y']\n\nres3 = r.json().get(\"doc\", \"$.obj.keys().count()\")\nprint(res3)\n# >>> [2]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex177",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'obj' => { 'x' => 1, 'y' => 2 } })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.obj.keys()')\np res2 # >>> [\"x\", \"y\"]\n\nres3 = r.json_get('doc', '$.obj.keys().count()')\np res3 # >>> [2]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex178",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"obj\":{\"x\":1,\"y\":2}})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.obj.keys()\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [\"x\",\"y\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.obj.keys().count()\").await {\n            Ok(res2) => {\n                let res2: String = res2;\n                println!(\"{res2}\");    // >>> [2]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex179",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"obj\":{\"x\":1,\"y\":2}})) {\n            Ok(res38) => {\n                let res38: bool = res38;\n                println!(\"{}\", if res38 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.obj.keys()\") {\n            Ok(res39) => {\n                let res39: String = res39;\n                println!(\"{res39}\");    // >>> [\"x\",\"y\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.obj.keys().count()\") {\n            Ok(res40) => {\n                let res40: String = res40;\n                println!(\"{res40}\");    // >>> [2]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex180",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":[\"abc\",\"xabc\",\"a\",\"b\"]}'\nOK\n> JSON.GET doc '$.a[?match(@, \"a.*\")]'\n\"[\\\"abc\\\",\\\"a\\\"]\"\n> JSON.SET doc $ '{\"a\":[\"abc\",\"xyz\",\"b\"]}'\nOK\n> JSON.GET doc '$.a[?search(@, \"b\")]'\n\"[\\\"abc\\\",\\\"b\\\"]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex181",
      "language": "csharp",
      "code": "bool res41 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[\\\"abc\\\",\\\"xabc\\\",\\\"a\\\",\\\"b\\\"]}\");\n        Console.WriteLine(res41);   // >>> True\n\n        RedisResult res42 = db.JSON().Get(\"doc\", path: \"$.a[?match(@, \\\"a.*\\\")]\");\n        Console.WriteLine(res42);   // >>> [\"abc\",\"a\"]\n\n        bool res43 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[\\\"abc\\\",\\\"xyz\\\",\\\"b\\\"]}\");\n        Console.WriteLine(res43);   // >>> True\n\n        RedisResult res44 = db.JSON().Get(\"doc\", path: \"$.a[?search(@, \\\"b\\\")]\");\n        Console.WriteLine(res44);   // >>> [\"abc\",\"b\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex182",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[\"abc\",\"xabc\",\"a\",\"b\"]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a[?match(@, \"a.*\")]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [\"abc\",\"a\"]\n\n\tres3, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[\"abc\",\"xyz\",\"b\"]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> OK\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$.a[?search(@, \"b\")]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [\"abc\",\"b\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex183",
      "language": "java",
      "code": "CompletableFuture<Void> funcMatchSearchExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[\\\"abc\\\",\\\"xabc\\\",\\\"a\\\",\\\"b\\\"]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?match(@, \\\"a.*\\\")]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[\"abc\",\"a\"]]\n                        return asyncCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                                parser.createJsonValue(\"{\\\"a\\\":[\\\"abc\\\",\\\"xyz\\\",\\\"b\\\"]}\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?search(@, \\\"b\\\")]\"));\n                    }).thenAccept(res4 -> {\n                        System.out.println(res4); // >>> [[\"abc\",\"b\"]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex184",
      "language": "java",
      "code": "Mono<Void> funcMatchSearchExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":[\\\"abc\\\",\\\"xabc\\\",\\\"a\\\",\\\"b\\\"]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?match(@, \\\"a.*\\\")]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[\"abc\",\"a\"]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[\\\"abc\\\",\\\"xyz\\\",\\\"b\\\"]}\")))\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> OK\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?search(@, \\\"b\\\")]\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[\"abc\",\"b\"]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex185",
      "language": "java",
      "code": "String res41 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[\\\"abc\\\",\\\"xabc\\\",\\\"a\\\",\\\"b\\\"]}\");\n        System.out.println(res41);    // >>> OK\n\n        Object res42 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?match(@, \\\"a.*\\\")]\"));\n        System.out.println(res42);    // >>> [\"abc\",\"a\"]\n\n        String res43 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[\\\"abc\\\",\\\"xyz\\\",\\\"b\\\"]}\");\n        System.out.println(res43);    // >>> OK\n\n        Object res44 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?search(@, \\\"b\\\")]\"));\n        System.out.println(res44);    // >>> [\"abc\",\"b\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex186",
      "language": "javascript",
      "code": "const res41 = await client.json.set('doc', '$', { a: ['abc', 'xabc', 'a', 'b'] });\nconsole.log(res41); // >>> OK\n\nconst res42 = await client.json.get('doc', { path: '$.a[?match(@, \"a.*\")]' });\nconsole.log(res42); // >>> [ 'abc', 'a' ]\n\nconst res43 = await client.json.set('doc', '$', { a: ['abc', 'xyz', 'b'] });\nconsole.log(res43); // >>> OK\n\nconst res44 = await client.json.get('doc', { path: '$.a[?search(@, \"b\")]' });\nconsole.log(res44); // >>> [ 'abc', 'b' ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex187",
      "language": "php",
      "code": "$res41 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [\"abc\", \"xabc\", \"a\", \"b\"]]\n        ));\n        echo $res41 . PHP_EOL; // >>> OK\n\n        $res42 = $this->redis->jsonget('doc', '', '', '', '$.a[?match(@, \"a.*\")]');\n        echo $res42 . PHP_EOL; // >>> [\"abc\",\"a\"]\n\n        $res43 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [\"abc\", \"xyz\", \"b\"]]\n        ));\n        echo $res43 . PHP_EOL; // >>> OK\n\n        $res44 = $this->redis->jsonget('doc', '', '', '', '$.a[?search(@, \"b\")]');\n        echo $res44 . PHP_EOL; // >>> [\"abc\",\"b\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex188",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": [\"abc\", \"xabc\", \"a\", \"b\"]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", '$.a[?match(@, \"a.*\")]')\nprint(res2)\n# >>> ['abc', 'a']\n\nres3 = r.json().set(\"doc\", \"$\", {\"a\": [\"abc\", \"xyz\", \"b\"]})\nprint(res3)\n# >>> True\n\nres4 = r.json().get(\"doc\", '$.a[?search(@, \"b\")]')\nprint(res4)\n# >>> ['abc', 'b']",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex189",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => ['abc', 'xabc', 'a', 'b'] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a[?match(@, \"a.*\")]')\np res2 # >>> [\"abc\", \"a\"]\n\nres3 = r.json_set('doc', '$', { 'a' => ['abc', 'xyz', 'b'] })\nputs res3 # >>> OK\n\nres4 = r.json_get('doc', '$.a[?search(@, \"b\")]')\np res4 # >>> [\"abc\", \"b\"]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex190",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[\"abc\",\"xabc\",\"a\",\"b\"]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", r#\"$.a[?match(@, \"a.*\")]\"#).await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [\"abc\",\"a\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[\"abc\",\"xyz\",\"b\"]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", r#\"$.a[?search(@, \"b\")]\"#).await {\n            Ok(res2) => {\n                let res2: String = res2;\n                println!(\"{res2}\");    // >>> [\"abc\",\"b\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex191",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":[\"abc\",\"xabc\",\"a\",\"b\"]})) {\n            Ok(res41) => {\n                let res41: bool = res41;\n                println!(\"{}\", if res41 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", r#\"$.a[?match(@, \"a.*\")]\"#) {\n            Ok(res42) => {\n                let res42: String = res42;\n                println!(\"{res42}\");    // >>> [\"abc\",\"a\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_set(\"doc\", \"$\", &json!({\"a\":[\"abc\",\"xyz\",\"b\"]})) {\n            Ok(res43) => {\n                let res43: bool = res43;\n                println!(\"{}\", if res43 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", r#\"$.a[?search(@, \"b\")]\"#) {\n            Ok(res44) => {\n                let res44: String = res44;\n                println!(\"{res44}\");    // >>> [\"abc\",\"b\"]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex192",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":[{\"x\":\"a\",\"y\":\"b\"},{\"x\":\"a\",\"y\":\"c\"}]}'\nOK\n> JSON.GET doc '$.a[?concat(@.x, @.y) == \"ab\"]'\n\"[{\\\"x\\\":\\\"a\\\",\\\"y\\\":\\\"b\\\"}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex193",
      "language": "csharp",
      "code": "bool res45 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[{\\\"x\\\":\\\"a\\\",\\\"y\\\":\\\"b\\\"},{\\\"x\\\":\\\"a\\\",\\\"y\\\":\\\"c\\\"}]}\");\n        Console.WriteLine(res45);   // >>> True\n\n        RedisResult res46 = db.JSON().Get(\"doc\", path: \"$.a[?concat(@.x, @.y) == \\\"ab\\\"]\");\n        Console.WriteLine(res46);   // >>> [{\"x\":\"a\",\"y\":\"b\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex194",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[{\"x\":\"a\",\"y\":\"b\"},{\"x\":\"a\",\"y\":\"c\"}]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a[?concat(@.x, @.y) == \"ab\"]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [{\"x\":\"a\",\"y\":\"b\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex195",
      "language": "java",
      "code": "CompletableFuture<Void> funcConcatExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[{\\\"x\\\":\\\"a\\\",\\\"y\\\":\\\"b\\\"},{\\\"x\\\":\\\"a\\\",\\\"y\\\":\\\"c\\\"}]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?concat(@.x, @.y) == \\\"ab\\\"]\"));\n                    }).thenAccept(res2 -> {\n                        System.out.println(res2); // >>> [[{\"x\":\"a\",\"y\":\"b\"}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex196",
      "language": "java",
      "code": "Mono<Void> funcConcatExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[{\\\"x\\\":\\\"a\\\",\\\"y\\\":\\\"b\\\"},{\\\"x\\\":\\\"a\\\",\\\"y\\\":\\\"c\\\"}]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?concat(@.x, @.y) == \\\"ab\\\"]\"))\n                            .collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[{\"x\":\"a\",\"y\":\"b\"}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex197",
      "language": "java",
      "code": "String res45 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[{\\\"x\\\":\\\"a\\\",\\\"y\\\":\\\"b\\\"},{\\\"x\\\":\\\"a\\\",\\\"y\\\":\\\"c\\\"}]}\");\n        System.out.println(res45);    // >>> OK\n\n        Object res46 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?concat(@.x, @.y) == \\\"ab\\\"]\"));\n        System.out.println(res46);    // >>> [{\"x\":\"a\",\"y\":\"b\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex198",
      "language": "javascript",
      "code": "const res45 = await client.json.set('doc', '$', { a: [{ x: 'a', y: 'b' }, { x: 'a', y: 'c' }] });\nconsole.log(res45); // >>> OK\n\nconst res46 = await client.json.get('doc', { path: '$.a[?concat(@.x, @.y) == \"ab\"]' });\nconsole.log(res46); // >>> [ { x: 'a', y: 'b' } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex199",
      "language": "php",
      "code": "$res45 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[\"x\" => \"a\", \"y\" => \"b\"], [\"x\" => \"a\", \"y\" => \"c\"]]]\n        ));\n        echo $res45 . PHP_EOL; // >>> OK\n\n        $res46 = $this->redis->jsonget('doc', '', '', '', '$.a[?concat(@.x, @.y) == \"ab\"]');\n        echo $res46 . PHP_EOL; // >>> [{\"x\":\"a\",\"y\":\"b\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex200",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": [{\"x\": \"a\", \"y\": \"b\"}, {\"x\": \"a\", \"y\": \"c\"}]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", '$.a[?concat(@.x, @.y) == \"ab\"]')\nprint(res2)\n# >>> [{'x': 'a', 'y': 'b'}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex201",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => [{ 'x' => 'a', 'y' => 'b' }, { 'x' => 'a', 'y' => 'c' }] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a[?concat(@.x, @.y) == \"ab\"]')\np res2 # >>> [{\"x\"=>\"a\", \"y\"=>\"b\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex202",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\n            \"doc\",\n            \"$\",\n            &json!({\"a\":[{\"x\":\"a\",\"y\":\"b\"},{\"x\":\"a\",\"y\":\"c\"}]}),\n        ).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", r#\"$.a[?concat(@.x, @.y) == \"ab\"]\"#).await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [{\"x\":\"a\",\"y\":\"b\"}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex203",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":[{\"x\":\"a\",\"y\":\"b\"},{\"x\":\"a\",\"y\":\"c\"}]})) {\n            Ok(res45) => {\n                let res45: bool = res45;\n                println!(\"{}\", if res45 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", r#\"$.a[?concat(@.x, @.y) == \"ab\"]\"#) {\n            Ok(res46) => {\n                let res46: String = res46;\n                println!(\"{res46}\");    // >>> [{\"x\":\"a\",\"y\":\"b\"}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex204",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":[2.1,3.9,1.0]}'\nOK\n> JSON.GET doc '$.a[?ceiling(@) == 3]'\n\"[2.1]\"\n> JSON.SET doc $ '{\"a\":[2.1,2.9,3.5]}'\nOK\n> JSON.GET doc '$.a[?floor(@) == 2]'\n\"[2.1,2.9]\"\n> JSON.SET doc $ '{\"a\":[{\"n\":-5},{\"n\":5},{\"n\":-3}]}'\nOK\n> JSON.GET doc '$.a[?abs(@.n) == 5]'\n\"[{\\\"n\\\":-5},{\\\"n\\\":5}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex205",
      "language": "csharp",
      "code": "bool res47 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[2.1,3.9,1.0]}\");\n        Console.WriteLine(res47);   // >>> True\n\n        RedisResult res48 = db.JSON().Get(\"doc\", path: \"$.a[?ceiling(@) == 3]\");\n        Console.WriteLine(res48);   // >>> [2.1]\n\n        bool res49 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[2.1,2.9,3.5]}\");\n        Console.WriteLine(res49);   // >>> True\n\n        RedisResult res50 = db.JSON().Get(\"doc\", path: \"$.a[?floor(@) == 2]\");\n        Console.WriteLine(res50);   // >>> [2.1,2.9]\n\n        bool res51 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[{\\\"n\\\":-5},{\\\"n\\\":5},{\\\"n\\\":-3}]}\");\n        Console.WriteLine(res51);   // >>> True\n\n        RedisResult res52 = db.JSON().Get(\"doc\", path: \"$.a[?abs(@.n) == 5]\");\n        Console.WriteLine(res52);   // >>> [{\"n\":-5},{\"n\":5}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex206",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[2.1,3.9,1.0]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a[?ceiling(@) == 3]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [2.1]\n\n\tres3, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[2.1,2.9,3.5]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> OK\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$.a[?floor(@) == 2]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [2.1,2.9]\n\n\tres5, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[{\"n\":-5},{\"n\":5},{\"n\":-3}]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res5) // >>> OK\n\n\tres6, err := rdb.JSONGet(ctx, \"doc\", `$.a[?abs(@.n) == 5]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res6) // >>> [{\"n\":-5},{\"n\":5}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex207",
      "language": "java",
      "code": "CompletableFuture<Void> funcMathExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":[2.1,3.9,1.0]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?ceiling(@) == 3]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[2.1]]\n                        return asyncCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                                parser.createJsonValue(\"{\\\"a\\\":[2.1,2.9,3.5]}\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?floor(@) == 2]\"));\n                    }).thenCompose(res4 -> {\n                        System.out.println(res4); // >>> [[2.1,2.9]]\n                        return asyncCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                                parser.createJsonValue(\"{\\\"a\\\":[{\\\"n\\\":-5},{\\\"n\\\":5},{\\\"n\\\":-3}]}\"));\n                    }).thenCompose(res5 -> {\n                        System.out.println(res5); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?abs(@.n) == 5]\"));\n                    }).thenAccept(res6 -> {\n                        System.out.println(res6); // >>> [[{\"n\":-5},{\"n\":5}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex208",
      "language": "java",
      "code": "Mono<Void> funcMathExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":[2.1,3.9,1.0]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?ceiling(@) == 3]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[2.1]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[2.1,2.9,3.5]}\")))\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> OK\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?floor(@) == 2]\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[2.1,2.9]]\n                    })\n                    .flatMap(res4 -> reactiveCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[{\\\"n\\\":-5},{\\\"n\\\":5},{\\\"n\\\":-3}]}\")))\n                    .doOnNext(res5 -> {\n                        System.out.println(res5); // >>> OK\n                    })\n                    .flatMap(res5 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?abs(@.n) == 5]\")).collectList())\n                    .doOnNext(res6 -> {\n                        System.out.println(res6); // >>> [[{\"n\":-5},{\"n\":5}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex209",
      "language": "java",
      "code": "String res47 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[2.1,3.9,1.0]}\");\n        System.out.println(res47);    // >>> OK\n\n        Object res48 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?ceiling(@) == 3]\"));\n        System.out.println(res48);    // >>> [2.1]\n\n        String res49 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[2.1,2.9,3.5]}\");\n        System.out.println(res49);    // >>> OK\n\n        Object res50 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?floor(@) == 2]\"));\n        System.out.println(res50);    // >>> [2.1,2.9]\n\n        String res51 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[{\\\"n\\\":-5},{\\\"n\\\":5},{\\\"n\\\":-3}]}\");\n        System.out.println(res51);    // >>> OK\n\n        Object res52 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?abs(@.n) == 5]\"));\n        System.out.println(res52);    // >>> [{\"n\":-5},{\"n\":5}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex210",
      "language": "javascript",
      "code": "const res47 = await client.json.set('doc', '$', { a: [2.1, 3.9, 1.0] });\nconsole.log(res47); // >>> OK\n\nconst res48 = await client.json.get('doc', { path: '$.a[?ceiling(@) == 3]' });\nconsole.log(res48); // >>> [ 2.1 ]\n\nconst res49 = await client.json.set('doc', '$', { a: [2.1, 2.9, 3.5] });\nconsole.log(res49); // >>> OK\n\nconst res50 = await client.json.get('doc', { path: '$.a[?floor(@) == 2]' });\nconsole.log(res50); // >>> [ 2.1, 2.9 ]\n\nconst res51 = await client.json.set('doc', '$', { a: [{ n: -5 }, { n: 5 }, { n: -3 }] });\nconsole.log(res51); // >>> OK\n\nconst res52 = await client.json.get('doc', { path: '$.a[?abs(@.n) == 5]' });\nconsole.log(res52); // >>> [ { n: -5 }, { n: 5 } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex211",
      "language": "php",
      "code": "$res47 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [2.1, 3.9, 1.0]]\n        ));\n        echo $res47 . PHP_EOL; // >>> OK\n\n        $res48 = $this->redis->jsonget('doc', '', '', '', '$.a[?ceiling(@) == 3]');\n        echo $res48 . PHP_EOL; // >>> [2.1]\n\n        $res49 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [2.1, 2.9, 3.5]]\n        ));\n        echo $res49 . PHP_EOL; // >>> OK\n\n        $res50 = $this->redis->jsonget('doc', '', '', '', '$.a[?floor(@) == 2]');\n        echo $res50 . PHP_EOL; // >>> [2.1,2.9]\n\n        $res51 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[\"n\" => -5], [\"n\" => 5], [\"n\" => -3]]]\n        ));\n        echo $res51 . PHP_EOL; // >>> OK\n\n        $res52 = $this->redis->jsonget('doc', '', '', '', '$.a[?abs(@.n) == 5]');\n        echo $res52 . PHP_EOL; // >>> [{\"n\":-5},{\"n\":5}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex212",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": [2.1, 3.9, 1.0]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.a[?ceiling(@) == 3]\")\nprint(res2)\n# >>> [2.1]\n\nres3 = r.json().set(\"doc\", \"$\", {\"a\": [2.1, 2.9, 3.5]})\nprint(res3)\n# >>> True\n\nres4 = r.json().get(\"doc\", \"$.a[?floor(@) == 2]\")\nprint(res4)\n# >>> [2.1, 2.9]\n\nres5 = r.json().set(\"doc\", \"$\", {\"a\": [{\"n\": -5}, {\"n\": 5}, {\"n\": -3}]})\nprint(res5)\n# >>> True\n\nres6 = r.json().get(\"doc\", \"$.a[?abs(@.n) == 5]\")\nprint(res6)\n# >>> [{'n': -5}, {'n': 5}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex213",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => [2.1, 3.9, 1.0] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a[?ceiling(@) == 3]')\np res2 # >>> [2.1]\n\nres3 = r.json_set('doc', '$', { 'a' => [2.1, 2.9, 3.5] })\nputs res3 # >>> OK\n\nres4 = r.json_get('doc', '$.a[?floor(@) == 2]')\np res4 # >>> [2.1, 2.9]\n\nres5 = r.json_set('doc', '$', { 'a' => [{ 'n' => -5 }, { 'n' => 5 }, { 'n' => -3 }] })\nputs res5 # >>> OK\n\nres6 = r.json_get('doc', '$.a[?abs(@.n) == 5]')\np res6 # >>> [{\"n\"=>-5}, {\"n\"=>5}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex214",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[2.1,3.9,1.0]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?ceiling(@) == 3]\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [2.1]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":[2.1,2.9,3.5]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?floor(@) == 2]\").await {\n            Ok(res2) => {\n                let res2: String = res2;\n                println!(\"{res2}\");    // >>> [2.1,2.9]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        let _: bool = match r.json_set(\n            \"doc\",\n            \"$\",\n            &json!({\"a\":[{\"n\":-5},{\"n\":5},{\"n\":-3}]}),\n        ).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?abs(@.n) == 5]\").await {\n            Ok(res3) => {\n                let res3: String = res3;\n                println!(\"{res3}\");    // >>> [{\"n\":-5},{\"n\":5}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex215",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":[2.1,3.9,1.0]})) {\n            Ok(res47) => {\n                let res47: bool = res47;\n                println!(\"{}\", if res47 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?ceiling(@) == 3]\") {\n            Ok(res48) => {\n                let res48: String = res48;\n                println!(\"{res48}\");    // >>> [2.1]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_set(\"doc\", \"$\", &json!({\"a\":[2.1,2.9,3.5]})) {\n            Ok(res49) => {\n                let res49: bool = res49;\n                println!(\"{}\", if res49 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?floor(@) == 2]\") {\n            Ok(res50) => {\n                let res50: String = res50;\n                println!(\"{res50}\");    // >>> [2.1,2.9]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_set(\"doc\", \"$\", &json!({\"a\":[{\"n\":-5},{\"n\":5},{\"n\":-3}]})) {\n            Ok(res51) => {\n                let res51: bool = res51;\n                println!(\"{}\", if res51 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?abs(@.n) == 5]\") {\n            Ok(res52) => {\n                let res52: String = res52;\n                println!(\"{res52}\");    // >>> [{\"n\":-5},{\"n\":5}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex216",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":[{\"n\":[1,2]},{\"n\":[9,8]}]}'\nOK\n> JSON.GET doc '$.a[?first(@.n) == 1]'\n\"[{\\\"n\\\":[1,2]}]\"\n> JSON.GET doc '$.a[?last(@.n) == 8]'\n\"[{\\\"n\\\":[9,8]}]\"\n> JSON.GET doc '$.a[?index(@.n, -1) == 2]'\n\"[{\\\"n\\\":[1,2]}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex217",
      "language": "csharp",
      "code": "bool res53 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[{\\\"n\\\":[1,2]},{\\\"n\\\":[9,8]}]}\");\n        Console.WriteLine(res53);   // >>> True\n\n        RedisResult res54 = db.JSON().Get(\"doc\", path: \"$.a[?first(@.n) == 1]\");\n        Console.WriteLine(res54);   // >>> [{\"n\":[1,2]}]\n\n        RedisResult res55 = db.JSON().Get(\"doc\", path: \"$.a[?last(@.n) == 8]\");\n        Console.WriteLine(res55);   // >>> [{\"n\":[9,8]}]\n\n        RedisResult res56 = db.JSON().Get(\"doc\", path: \"$.a[?index(@.n, -1) == 2]\");\n        Console.WriteLine(res56);   // >>> [{\"n\":[1,2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex218",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[{\"n\":[1,2]},{\"n\":[9,8]}]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a[?first(@.n) == 1]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [{\"n\":[1,2]}]\n\n\tres3, err := rdb.JSONGet(ctx, \"doc\", `$.a[?last(@.n) == 8]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> [{\"n\":[9,8]}]\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$.a[?index(@.n, -1) == 2]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [{\"n\":[1,2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex219",
      "language": "java",
      "code": "CompletableFuture<Void> funcArrayAccessExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[{\\\"n\\\":[1,2]},{\\\"n\\\":[9,8]}]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?first(@.n) == 1]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[{\"n\":[1,2]}]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?last(@.n) == 8]\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> [[{\"n\":[9,8]}]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?index(@.n, -1) == 2]\"));\n                    }).thenAccept(res4 -> {\n                        System.out.println(res4); // >>> [[{\"n\":[1,2]}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex220",
      "language": "java",
      "code": "Mono<Void> funcArrayAccessExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":[{\\\"n\\\":[1,2]},{\\\"n\\\":[9,8]}]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?first(@.n) == 1]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[{\"n\":[1,2]}]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?last(@.n) == 8]\")).collectList())\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> [[{\"n\":[9,8]}]]\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?index(@.n, -1) == 2]\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[{\"n\":[1,2]}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex221",
      "language": "java",
      "code": "String res53 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[{\\\"n\\\":[1,2]},{\\\"n\\\":[9,8]}]}\");\n        System.out.println(res53);    // >>> OK\n\n        Object res54 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?first(@.n) == 1]\"));\n        System.out.println(res54);    // >>> [{\"n\":[1,2]}]\n\n        Object res55 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?last(@.n) == 8]\"));\n        System.out.println(res55);    // >>> [{\"n\":[9,8]}]\n\n        Object res56 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?index(@.n, -1) == 2]\"));\n        System.out.println(res56);    // >>> [{\"n\":[1,2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex222",
      "language": "javascript",
      "code": "const res53 = await client.json.set('doc', '$', { a: [{ n: [1, 2] }, { n: [9, 8] }] });\nconsole.log(res53); // >>> OK\n\nconst res54 = await client.json.get('doc', { path: '$.a[?first(@.n) == 1]' });\nconsole.log(res54); // >>> [ { n: [ 1, 2 ] } ]\n\nconst res55 = await client.json.get('doc', { path: '$.a[?last(@.n) == 8]' });\nconsole.log(res55); // >>> [ { n: [ 9, 8 ] } ]\n\nconst res56 = await client.json.get('doc', { path: '$.a[?index(@.n, -1) == 2]' });\nconsole.log(res56); // >>> [ { n: [ 1, 2 ] } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex223",
      "language": "php",
      "code": "$res53 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[\"n\" => [1, 2]], [\"n\" => [9, 8]]]]\n        ));\n        echo $res53 . PHP_EOL; // >>> OK\n\n        $res54 = $this->redis->jsonget('doc', '', '', '', '$.a[?first(@.n) == 1]');\n        echo $res54 . PHP_EOL; // >>> [{\"n\":[1,2]}]\n\n        $res55 = $this->redis->jsonget('doc', '', '', '', '$.a[?last(@.n) == 8]');\n        echo $res55 . PHP_EOL; // >>> [{\"n\":[9,8]}]\n\n        $res56 = $this->redis->jsonget('doc', '', '', '', '$.a[?index(@.n, -1) == 2]');\n        echo $res56 . PHP_EOL; // >>> [{\"n\":[1,2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex224",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": [{\"n\": [1, 2]}, {\"n\": [9, 8]}]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.a[?first(@.n) == 1]\")\nprint(res2)\n# >>> [{'n': [1, 2]}]\n\nres3 = r.json().get(\"doc\", \"$.a[?last(@.n) == 8]\")\nprint(res3)\n# >>> [{'n': [9, 8]}]\n\nres4 = r.json().get(\"doc\", \"$.a[?index(@.n, -1) == 2]\")\nprint(res4)\n# >>> [{'n': [1, 2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex225",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => [{ 'n' => [1, 2] }, { 'n' => [9, 8] }] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a[?first(@.n) == 1]')\np res2 # >>> [{\"n\"=>[1, 2]}]\n\nres3 = r.json_get('doc', '$.a[?last(@.n) == 8]')\np res3 # >>> [{\"n\"=>[9, 8]}]\n\nres4 = r.json_get('doc', '$.a[?index(@.n, -1) == 2]')\np res4 # >>> [{\"n\"=>[1, 2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex226",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\n            \"doc\",\n            \"$\",\n            &json!({\"a\":[{\"n\":[1,2]},{\"n\":[9,8]}]}),\n        ).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?first(@.n) == 1]\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [{\"n\":[1,2]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?last(@.n) == 8]\").await {\n            Ok(res2) => {\n                let res2: String = res2;\n                println!(\"{res2}\");    // >>> [{\"n\":[9,8]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?index(@.n, -1) == 2]\").await {\n            Ok(res3) => {\n                let res3: String = res3;\n                println!(\"{res3}\");    // >>> [{\"n\":[1,2]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex227",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":[{\"n\":[1,2]},{\"n\":[9,8]}]})) {\n            Ok(res53) => {\n                let res53: bool = res53;\n                println!(\"{}\", if res53 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?first(@.n) == 1]\") {\n            Ok(res54) => {\n                let res54: String = res54;\n                println!(\"{res54}\");    // >>> [{\"n\":[1,2]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?last(@.n) == 8]\") {\n            Ok(res55) => {\n                let res55: String = res55;\n                println!(\"{res55}\");    // >>> [{\"n\":[9,8]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?index(@.n, -1) == 2]\") {\n            Ok(res56) => {\n                let res56: String = res56;\n                println!(\"{res56}\");    // >>> [{\"n\":[1,2]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex228",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":[{\"n\":[3,1,2]},{\"n\":[5,6]}]}'\nOK\n> JSON.GET doc '$.a[?sum(@.n) == 6]'\n\"[{\\\"n\\\":[3,1,2]}]\"\n> JSON.GET doc '$.a[?avg(@.n) == 2]'\n\"[{\\\"n\\\":[3,1,2]}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex229",
      "language": "csharp",
      "code": "bool res57 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":[{\\\"n\\\":[3,1,2]},{\\\"n\\\":[5,6]}]}\");\n        Console.WriteLine(res57);   // >>> True\n\n        RedisResult res58 = db.JSON().Get(\"doc\", path: \"$.a[?sum(@.n) == 6]\");\n        Console.WriteLine(res58);   // >>> [{\"n\":[3,1,2]}]\n\n        RedisResult res59 = db.JSON().Get(\"doc\", path: \"$.a[?avg(@.n) == 2]\");\n        Console.WriteLine(res59);   // >>> [{\"n\":[3,1,2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex230",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":[{\"n\":[3,1,2]},{\"n\":[5,6]}]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a[?sum(@.n) == 6]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [{\"n\":[3,1,2]}]\n\n\tres3, err := rdb.JSONGet(ctx, \"doc\", `$.a[?avg(@.n) == 2]`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> [{\"n\":[3,1,2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex231",
      "language": "java",
      "code": "CompletableFuture<Void> funcAggregateExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[{\\\"n\\\":[3,1,2]},{\\\"n\\\":[5,6]}]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?sum(@.n) == 6]\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[{\"n\":[3,1,2]}]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?avg(@.n) == 2]\"));\n                    }).thenAccept(res3 -> {\n                        System.out.println(res3); // >>> [[{\"n\":[3,1,2]}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex232",
      "language": "java",
      "code": "Mono<Void> funcAggregateExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":[{\\\"n\\\":[3,1,2]},{\\\"n\\\":[5,6]}]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?sum(@.n) == 6]\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[{\"n\":[3,1,2]}]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a[?avg(@.n) == 2]\")).collectList())\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> [[{\"n\":[3,1,2]}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex233",
      "language": "java",
      "code": "String res57 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":[{\\\"n\\\":[3,1,2]},{\\\"n\\\":[5,6]}]}\");\n        System.out.println(res57);    // >>> OK\n\n        Object res58 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?sum(@.n) == 6]\"));\n        System.out.println(res58);    // >>> [{\"n\":[3,1,2]}]\n\n        Object res59 = jedis.jsonGet(\"doc\", new Path2(\"$.a[?avg(@.n) == 2]\"));\n        System.out.println(res59);    // >>> [{\"n\":[3,1,2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex234",
      "language": "javascript",
      "code": "const res57 = await client.json.set('doc', '$', { a: [{ n: [3, 1, 2] }, { n: [5, 6] }] });\nconsole.log(res57); // >>> OK\n\nconst res58 = await client.json.get('doc', { path: '$.a[?sum(@.n) == 6]' });\nconsole.log(res58); // >>> [ { n: [ 3, 1, 2 ] } ]\n\nconst res59 = await client.json.get('doc', { path: '$.a[?avg(@.n) == 2]' });\nconsole.log(res59); // >>> [ { n: [ 3, 1, 2 ] } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex235",
      "language": "php",
      "code": "$res57 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => [[\"n\" => [3, 1, 2]], [\"n\" => [5, 6]]]]\n        ));\n        echo $res57 . PHP_EOL; // >>> OK\n\n        $res58 = $this->redis->jsonget('doc', '', '', '', '$.a[?sum(@.n) == 6]');\n        echo $res58 . PHP_EOL; // >>> [{\"n\":[3,1,2]}]\n\n        $res59 = $this->redis->jsonget('doc', '', '', '', '$.a[?avg(@.n) == 2]');\n        echo $res59 . PHP_EOL; // >>> [{\"n\":[3,1,2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex236",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": [{\"n\": [3, 1, 2]}, {\"n\": [5, 6]}]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.a[?sum(@.n) == 6]\")\nprint(res2)\n# >>> [{'n': [3, 1, 2]}]\n\nres3 = r.json().get(\"doc\", \"$.a[?avg(@.n) == 2]\")\nprint(res3)\n# >>> [{'n': [3, 1, 2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex237",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => [{ 'n' => [3, 1, 2] }, { 'n' => [5, 6] }] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a[?sum(@.n) == 6]')\np res2 # >>> [{\"n\"=>[3, 1, 2]}]\n\nres3 = r.json_get('doc', '$.a[?avg(@.n) == 2]')\np res3 # >>> [{\"n\"=>[3, 1, 2]}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex238",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\n            \"doc\",\n            \"$\",\n            &json!({\"a\":[{\"n\":[3,1,2]},{\"n\":[5,6]}]}),\n        ).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a[?sum(@.n) == 6]\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [{\"n\":[3,1,2]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?avg(@.n) == 2]\").await {\n            Ok(res2) => {\n                let res2: String = res2;\n                println!(\"{res2}\");    // >>> [{\"n\":[3,1,2]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex239",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":[{\"n\":[3,1,2]},{\"n\":[5,6]}]})) {\n            Ok(res57) => {\n                let res57: bool = res57;\n                println!(\"{}\", if res57 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?sum(@.n) == 6]\") {\n            Ok(res58) => {\n                let res58: String = res58;\n                println!(\"{res58}\");    // >>> [{\"n\":[3,1,2]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a[?avg(@.n) == 2]\") {\n            Ok(res59) => {\n                let res59: String = res59;\n                println!(\"{res59}\");    // >>> [{\"n\":[3,1,2]}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex240",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"arr\":[1,2,3]}'\nOK\n> JSON.GET doc '$.arr.append(9)'\n\"[1,2,3,9]\"\n> JSON.SET doc $ '{\"books\":[{\"t\":\"a\",\"price\":30},{\"t\":\"b\",\"price\":5}]}'\nOK\n> JSON.GET doc '$.books[?(@.price >= 10)].append({\"t\":\"X\"})'\n\"[{\\\"t\\\":\\\"a\\\",\\\"price\\\":30},{\\\"t\\\":\\\"X\\\"}]\"",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex241",
      "language": "csharp",
      "code": "bool res60 = db.JSON().Set(\"doc\", \"$\", \"{\\\"arr\\\":[1,2,3]}\");\n        Console.WriteLine(res60);   // >>> True\n\n        RedisResult res61 = db.JSON().Get(\"doc\", path: \"$.arr.append(9)\");\n        Console.WriteLine(res61);   // >>> [1,2,3,9]\n\n        bool res62 = db.JSON().Set(\"doc\", \"$\", \"{\\\"books\\\":[{\\\"t\\\":\\\"a\\\",\\\"price\\\":30},{\\\"t\\\":\\\"b\\\",\\\"price\\\":5}]}\");\n        Console.WriteLine(res62);   // >>> True\n\n        RedisResult res63 = db.JSON().Get(\"doc\", path: \"$.books[?(@.price >= 10)].append({\\\"t\\\":\\\"X\\\"})\");\n        Console.WriteLine(res63);   // >>> [{\"t\":\"a\",\"price\":30},{\"t\":\"X\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex242",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"arr\":[1,2,3]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.arr.append(9)`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [1,2,3,9]\n\n\tres3, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"books\":[{\"t\":\"a\",\"price\":30},{\"t\":\"b\",\"price\":5}]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> OK\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `$.books[?(@.price >= 10)].append({\"t\":\"X\"})`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [{\"t\":\"a\",\"price\":30},{\"t\":\"X\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex243",
      "language": "java",
      "code": "CompletableFuture<Void> funcAppendExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"arr\\\":[1,2,3]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.arr.append(9)\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[1,2,3,9]]\n                        return asyncCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                                parser.createJsonValue(\n                                        \"{\\\"books\\\":[{\\\"t\\\":\\\"a\\\",\\\"price\\\":30},{\\\"t\\\":\\\"b\\\",\\\"price\\\":5}]}\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\",\n                                JsonPath.of(\"$.books[?(@.price >= 10)].append({\\\"t\\\":\\\"X\\\"})\"));\n                    }).thenAccept(res4 -> {\n                        System.out.println(res4); // >>> [[{\"t\":\"a\",\"price\":30},{\"t\":\"X\"}]]\n                    }).toCompletableFuture();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex244",
      "language": "java",
      "code": "Mono<Void> funcAppendExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"arr\\\":[1,2,3]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.arr.append(9)\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[1,2,3,9]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\n                                    \"{\\\"books\\\":[{\\\"t\\\":\\\"a\\\",\\\"price\\\":30},{\\\"t\\\":\\\"b\\\",\\\"price\\\":5}]}\")))\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> OK\n                    })\n                    .flatMap(res3 -> reactiveCommands\n                            .jsonGet(\"doc\", JsonPath.of(\"$.books[?(@.price >= 10)].append({\\\"t\\\":\\\"X\\\"})\"))\n                            .collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[{\"t\":\"a\",\"price\":30},{\"t\":\"X\"}]]\n                    })\n                    .then();",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex245",
      "language": "java",
      "code": "String res60 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"arr\\\":[1,2,3]}\");\n        System.out.println(res60);    // >>> OK\n\n        Object res61 = jedis.jsonGet(\"doc\", new Path2(\"$.arr.append(9)\"));\n        System.out.println(res61);    // >>> [1,2,3,9]\n\n        String res62 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"books\\\":[{\\\"t\\\":\\\"a\\\",\\\"price\\\":30},{\\\"t\\\":\\\"b\\\",\\\"price\\\":5}]}\");\n        System.out.println(res62);    // >>> OK\n\n        Object res63 = jedis.jsonGet(\"doc\", new Path2(\"$.books[?(@.price >= 10)].append({\\\"t\\\":\\\"X\\\"})\"));\n        System.out.println(res63);    // >>> [{\"t\":\"a\",\"price\":30},{\"t\":\"X\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex246",
      "language": "javascript",
      "code": "const res60 = await client.json.set('doc', '$', { arr: [1, 2, 3] });\nconsole.log(res60); // >>> OK\n\nconst res61 = await client.json.get('doc', { path: '$.arr.append(9)' });\nconsole.log(res61); // >>> [ 1, 2, 3, 9 ]\n\nconst res62 = await client.json.set('doc', '$', {\n  books: [{ t: 'a', price: 30 }, { t: 'b', price: 5 }]\n});\nconsole.log(res62); // >>> OK\n\nconst res63 = await client.json.get('doc', { path: '$.books[?(@.price >= 10)].append({\"t\":\"X\"})' });\nconsole.log(res63); // >>> [ { t: 'a', price: 30 }, { t: 'X' } ]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex247",
      "language": "php",
      "code": "$res60 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"arr\" => [1, 2, 3]]\n        ));\n        echo $res60 . PHP_EOL; // >>> OK\n\n        $res61 = $this->redis->jsonget('doc', '', '', '', '$.arr.append(9)');\n        echo $res61 . PHP_EOL; // >>> [1,2,3,9]\n\n        $res62 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"books\" => [[\"t\" => \"a\", \"price\" => 30], [\"t\" => \"b\", \"price\" => 5]]]\n        ));\n        echo $res62 . PHP_EOL; // >>> OK\n\n        $res63 = $this->redis->jsonget('doc', '', '', '', '$.books[?(@.price >= 10)].append({\"t\":\"X\"})');\n        echo $res63 . PHP_EOL; // >>> [{\"t\":\"a\",\"price\":30},{\"t\":\"X\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex248",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"arr\": [1, 2, 3]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.arr.append(9)\")\nprint(res2)\n# >>> [1, 2, 3, 9]\n\nres3 = r.json().set(\"doc\", \"$\", {\"books\": [{\"t\": \"a\", \"price\": 30}, {\"t\": \"b\", \"price\": 5}]})\nprint(res3)\n# >>> True\n\nres4 = r.json().get(\"doc\", '$.books[?(@.price >= 10)].append({\"t\":\"X\"})')\nprint(res4)\n# >>> [{'t': 'a', 'price': 30}, {'t': 'X'}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex249",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'arr' => [1, 2, 3] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.arr.append(9)')\np res2 # >>> [1, 2, 3, 9]\n\nres3 = r.json_set('doc', '$', { 'books' => [{ 't' => 'a', 'price' => 30 }, { 't' => 'b', 'price' => 5 }] })\nputs res3 # >>> OK\n\nres4 = r.json_get('doc', '$.books[?(@.price >= 10)].append({\"t\":\"X\"})')\np res4 # >>> [{\"t\"=>\"a\", \"price\"=>30}, {\"t\"=>\"X\"}]",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex250",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"arr\":[1,2,3]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.arr.append(9)\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [1,2,3,9]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        let _: bool = match r.json_set(\n            \"doc\",\n            \"$\",\n            &json!({\"books\":[{\"t\":\"a\",\"price\":30},{\"t\":\"b\",\"price\":5}]}),\n        ).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", r#\"$.books[?(@.price >= 10)].append({\"t\":\"X\"})\"#).await {\n            Ok(res2) => {\n                let res2: String = res2;\n                println!(\"{res2}\");    // >>> [{\"t\":\"a\",\"price\":30},{\"t\":\"X\"}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "filter-examples-ex251",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"arr\":[1,2,3]})) {\n            Ok(res60) => {\n                let res60: bool = res60;\n                println!(\"{}\", if res60 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.arr.append(9)\") {\n            Ok(res61) => {\n                let res61: String = res61;\n                println!(\"{res61}\");    // >>> [1,2,3,9]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_set(\"doc\", \"$\", &json!({\"books\":[{\"t\":\"a\",\"price\":30},{\"t\":\"b\",\"price\":5}]})) {\n            Ok(res62) => {\n                let res62: bool = res62;\n                println!(\"{}\", if res62 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", r#\"$.books[?(@.price >= 10)].append({\"t\":\"X\"})\"#) {\n            Ok(res63) => {\n                let res63: String = res63;\n                println!(\"{res63}\");    // >>> [{\"t\":\"a\",\"price\":30},{\"t\":\"X\"}]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "filter-examples"
    },
    {
      "id": "update-examples-ex0",
      "language": "plaintext",
      "code": "> JSON.GET bikes:inventory $..price\n\"[1920,2072,3264,1475,3941]\"\n> JSON.NUMINCRBY bikes:inventory $..price -100\n\"[1820,1972,3164,1375,3841]\"\n> JSON.NUMINCRBY bikes:inventory $..price 100\n\"[1920,2072,3264,1475,3941]\"",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex1",
      "language": "csharp",
      "code": "RedisResult res42 = db.JSON().Get(\"bikes:inventory\", path: \"$..price\");\n        Console.WriteLine(res42);   // >>> [1920,2072,3264,1475,3941]\n\n        double?[] res43 = db.JSON().NumIncrby(\"bikes:inventory\", \"$..price\", -100);\n        Console.WriteLine(string.Join(\", \", res43));    // >>> 1820, 1972, 3164, 1375, 3841\n\n        double?[] res44 = db.JSON().NumIncrby(\"bikes:inventory\", \"$..price\", 100);\n        Console.WriteLine(string.Join(\", \", res44));    // >>> 1920, 2072, 3264, 1475, 3941",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex2",
      "language": "go",
      "code": "res15, err := rdb.JSONGet(ctx, \"bikes:inventory\", \"$..price\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res15) // >>> [1475,3941,1920,2072,3264]\n\n\tres16, err := rdb.JSONNumIncrBy(ctx, \"bikes:inventory\", \"$..price\", -100).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res16) // >>> [1375,3841,1820,1972,3164]\n\n\tres17, err := rdb.JSONNumIncrBy(ctx, \"bikes:inventory\", \"$..price\", 100).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res17) // >>> [1475,3941,1920,2072,3264]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex3",
      "language": "java",
      "code": "CompletableFuture<Void> updateBikes = asyncCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..price\"))\n                    .thenCompose(r -> {\n                        System.out.println(r); // >>> [[1920,2072,3264,1475,3941]]\n\n                        return asyncCommands.jsonNumincrby(\"bikes:inventory\", JsonPath.of(\"$..price\"), -100);\n                    }).thenCompose(res23 -> {\n                        System.out.println(res23); // >>> [1820, 1972, 3164, 1375, 3841]\n\n                        return asyncCommands.jsonNumincrby(\"bikes:inventory\", JsonPath.of(\"$..price\"), 100);\n                    })\n                    .thenAccept(System.out::println)\n                    // >>> [1920, 2072, 3264, 1475, 3941]\n                    .toCompletableFuture();",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex4",
      "language": "java",
      "code": "Mono<Void> updateBikes = reactiveCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..price\")).collectList()\n                    .doOnNext(r -> {\n                        System.out.println(r); // >>> [[1920,2072,3264,1475,3941]]\n                    })\n                    .flatMap(\n                            r -> reactiveCommands.jsonNumincrby(\"bikes:inventory\", JsonPath.of(\"$..price\"), -100).collectList())\n                    .doOnNext(res23 -> {\n                        System.out.println(res23); // >>> [1820, 1972, 3164, 1375, 3841]\n                    })\n                    .flatMap(res23 -> reactiveCommands.jsonNumincrby(\"bikes:inventory\", JsonPath.of(\"$..price\"), 100)\n                            .collectList())\n                    .doOnNext(System.out::println) // >>> [1920, 2072, 3264, 1475, 3941]\n                    .then();",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex5",
      "language": "java",
      "code": "Object res39 = jedis.jsonGet(\"bikes:inventory\", new Path2(\"$..price\"));\n        System.out.println(res39);\n        // >>> [1920,2072,3264,1475,3941]\n\n        Object res40 = jedis.jsonNumIncrBy(\"bikes:inventory\", new Path2(\"$..price\"), -100);\n        System.out.println(res40);  // >>> [1820,1972,3164,1375,3841]\n\n        Object res41 = jedis.jsonNumIncrBy(\"bikes:inventory\", new Path2(\"$..price\"), 100);\n        System.out.println(res41);  // >>> [1920,2072,3264,1475,3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex6",
      "language": "javascript",
      "code": "const res38 = await client.json.get(\"bikes:inventory\", {\n  path: \"$..price\"\n});\nconsole.log(res38);  //  [1920, 2072, 3264, 1475, 3941]\n\nconst res39 = await client.json.numIncrBy(\"bikes:inventory\", \"$..price\", -100);\nconsole.log(res39);  //  [1820, 1972, 3164, 1375, 3841]\n\nconst res40 = await client.json.numIncrBy(\"bikes:inventory\", \"$..price\", 100);\nconsole.log(res40);  //  [1920, 2072, 3264, 1475, 3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex7",
      "language": "php",
      "code": "$res15b = $r->jsonget('bikes:inventory', '', '', '', '$..price');\n        echo $res15b . PHP_EOL;\n        // >>> [1920,2072,3264,1475,3941]\n\n        $res16b = $r->jsonnumincrby('bikes:inventory', '$..price', -100);\n        echo json_encode($res16b) . PHP_EOL;\n        // >>> [1820,1972,3164,1375,3841]\n\n        $res17b = $r->jsonnumincrby('bikes:inventory', '$..price', 100);\n        echo json_encode($res17b) . PHP_EOL;\n        // >>> [1920,2072,3264,1475,3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex8",
      "language": "python",
      "code": "res15 = r.json().get(\"bikes:inventory\", \"$..price\")\nprint(res15)  # >>> [1920, 2072, 3264, 1475, 3941]\n\nres16 = r.json().numincrby(\"bikes:inventory\", \"$..price\", -100)\nprint(res16)  # >>> [1820, 1972, 3164, 1375, 3841]\n\nres17 = r.json().numincrby(\"bikes:inventory\", \"$..price\", 100)\nprint(res17)  # >>> [1920, 2072, 3264, 1475, 3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex9",
      "language": "ruby",
      "code": "res15 = r.json_get('bikes:inventory', '$..price')\np res15 # >>> [1920, 2072, 3264, 1475, 3941]\n\nres16 = r.json_numincrby('bikes:inventory', '$..price', -100)\np res16 # >>> [1820, 1972, 3164, 1375, 3841]\n\nres17 = r.json_numincrby('bikes:inventory', '$..price', 100)\np res17 # >>> [1920, 2072, 3264, 1475, 3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex10",
      "language": "rust",
      "code": "let res40: String = r\n            .json_get(\"bikes:inventory\", \"$..price\")\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res40}\"); // >>> [1920,2072,3264,1475,3941]\n\n        let res41: String = cmd(\"JSON.NUMINCRBY\")\n            .arg(\"bikes:inventory\")\n            .arg(\"$..price\")\n            .arg(-100)\n            .query_async(&mut r)\n            .await\n            .expect(\"Failed to run JSON.NUMINCRBY\");\n        println!(\"{res41}\"); // >>> [1820,1972,3164,1375,3841]\n\n        let res42: String = cmd(\"JSON.NUMINCRBY\")\n            .arg(\"bikes:inventory\")\n            .arg(\"$..price\")\n            .arg(100)\n            .query_async(&mut r)\n            .await\n            .expect(\"Failed to run JSON.NUMINCRBY\");\n        println!(\"{res42}\"); // >>> [1920,2072,3264,1475,3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex11",
      "language": "rust",
      "code": "let res40: String = r\n            .json_get(\"bikes:inventory\", \"$..price\")\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res40}\"); // >>> [1920,2072,3264,1475,3941]\n\n        let res41: String = cmd(\"JSON.NUMINCRBY\")\n            .arg(\"bikes:inventory\")\n            .arg(\"$..price\")\n            .arg(-100)\n            .query(&mut r)\n            .expect(\"Failed to run JSON.NUMINCRBY\");\n        println!(\"{res41}\"); // >>> [1820,1972,3164,1375,3841]\n\n        let res42: String = cmd(\"JSON.NUMINCRBY\")\n            .arg(\"bikes:inventory\")\n            .arg(\"$..price\")\n            .arg(100)\n            .query(&mut r)\n            .expect(\"Failed to run JSON.NUMINCRBY\");\n        println!(\"{res42}\"); // >>> [1920,2072,3264,1475,3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex12",
      "language": "plaintext",
      "code": "> JSON.SET bikes:inventory '$.inventory.*[?(@.price<2000)].price' 1500\nOK\n> JSON.GET bikes:inventory $..price\n\"[1500,2072,3264,1500,3941]\"",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex13",
      "language": "csharp",
      "code": "bool res45 = db.JSON().Set(\n            \"bikes:inventory\",\n            \"$.inventory.*[?(@.price<2000)].price\",\n            1500\n        );\n        Console.WriteLine(res45);   // >>> True\n\n        RedisResult res46 = db.JSON().Get(\"bikes:inventory\", path: \"$..price\");\n        Console.WriteLine(res46);   // >>> [1500,2072,3264,1500,3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex14",
      "language": "go",
      "code": "res18, err := rdb.JSONSet(ctx,\n\t\t\"bikes:inventory\",\n\t\t\"$.inventory.*[?(@.price<2000)].price\",\n\t\t1500,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res18) // >>> OK\n\n\tres19, err := rdb.JSONGet(ctx, \"bikes:inventory\", \"$..price\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res19) // >>> [1500,3941,1500,2072,3264]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex15",
      "language": "java",
      "code": "CompletableFuture<Void> updateFilters1 = asyncCommands.jsonSet(\"bikes:inventory\",\n                    JsonPath.of(\"$.inventory.*[?(@.price<2000)].price\"), parser.createJsonValue(\"1500\")).thenCompose(r -> {\n                        System.out.println(r); // >>> OK\n\n                        return asyncCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..price\"));\n                    })\n                    .thenAccept(System.out::println)\n                    // >>> [[1500,2072,3264,1500,3941]]\n                    .toCompletableFuture();",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex16",
      "language": "java",
      "code": "Mono<Void> updateFilters1 = reactiveCommands.jsonSet(\"bikes:inventory\",\n                    JsonPath.of(\"$.inventory.*[?(@.price<2000)].price\"), parser.createJsonValue(\"1500\")).doOnNext(r -> {\n                        System.out.println(r); // >>> OK\n                    }).flatMap(r -> reactiveCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..price\")).collectList())\n                    .doOnNext(System.out::println) // >>> [[1500,2072,3264,1500,3941]]\n                    .then();",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex17",
      "language": "java",
      "code": "jedis.jsonSet(\"bikes:inventory\", new Path2(\"$.inventory.*[?(@.price<2000)].price\"), 1500);\n        Object res42 = jedis.jsonGet(\"bikes:inventory\", new Path2(\"$..price\"));\n        System.out.println(res42);  // >>> [1500,2072,3264,1500,3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex18",
      "language": "javascript",
      "code": "const res40a = await client.json.set(\n  'bikes:inventory', \n  '$.inventory.*[?(@.price<2000)].price', \n  1500\n);\n\n// Get all prices from the inventory\nconst res40b = await client.json.get(\n  'bikes:inventory',\n  { path: \"$..price\" }\n);\nconsole.log(res40b); // [1500, 2072, 3264, 1500, 3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex19",
      "language": "php",
      "code": "$res18b = $r->jsonset('bikes:inventory', '$.inventory.*[?(@.price<2000)].price', '1500');\n        $res19b = $r->jsonget('bikes:inventory', '', '', '', '$..price');\n        echo $res19b . PHP_EOL;\n        // >>> [1500,2072,3264,1500,3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex20",
      "language": "python",
      "code": "res18 = r.json().set(\"bikes:inventory\", \"$.inventory.*[?(@.price<2000)].price\", 1500)\nres19 = r.json().get(\"bikes:inventory\", \"$..price\")\nprint(res19)  # >>> [1500, 2072, 3264, 1500, 3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex21",
      "language": "ruby",
      "code": "res18 = r.json_set('bikes:inventory', '$.inventory.*[?(@.price<2000)].price', 1500)\nres19 = r.json_get('bikes:inventory', '$..price')\np res19 # >>> [1500, 2072, 3264, 1500, 3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex22",
      "language": "rust",
      "code": "let _: bool = r\n            .json_set(\n                \"bikes:inventory\",\n                \"$.inventory.*[?(@.price<2000)].price\",\n                &json!(1500),\n            )\n            .await\n            .expect(\"Failed to run JSON.SET\");\n\n        let res43: String = r\n            .json_get(\"bikes:inventory\", \"$..price\")\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res43}\"); // >>> [1500,2072,3264,1500,3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex23",
      "language": "rust",
      "code": "let _: bool = r\n            .json_set(\n                \"bikes:inventory\",\n                \"$.inventory.*[?(@.price<2000)].price\",\n                &json!(1500),\n            )\n            .expect(\"Failed to run JSON.SET\");\n\n        let res43: String = r\n            .json_get(\"bikes:inventory\", \"$..price\")\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res43}\"); // >>> [1500,2072,3264,1500,3941]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex24",
      "language": "plaintext",
      "code": "> JSON.ARRAPPEND bikes:inventory '$.inventory.*[?(@.price<2000)].colors' '\"pink\"'\n1) (integer) 3\n2) (integer) 3\n> JSON.GET bikes:inventory $..[*].colors\n\"[[\\\"black\\\",\\\"silver\\\",\\\"pink\\\"],[\\\"black\\\",\\\"white\\\"],[\\\"black\\\",\\\"silver\\\",\\\"pink\\\"]]\"",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex25",
      "language": "csharp",
      "code": "long?[] res47 = db.JSON().ArrAppend(\n            \"bikes:inventory\", \"$.inventory.*[?(@.price<2000)].colors\", \"pink\"\n        );\n        Console.WriteLine(string.Join(\", \", res47));    // >>> 3, 3\n\n        RedisResult res48 = db.JSON().Get(\"bikes:inventory\", path: \"$..[*].colors\");\n        Console.WriteLine(res48);   // >>> [[\"black\",\"silver\",\"pink\"],[\"black\",\"white\"],[\"black\",\"silver\",\"pink\"]]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex26",
      "language": "go",
      "code": "res20, err := rdb.JSONArrAppend(ctx,\n\t\t\"bikes:inventory\",\n\t\t\"$.inventory.*[?(@.price<2000)].colors\",\n\t\t\"\\\"pink\\\"\",\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res20) // >>> [3 3]\n\n\tres21, err := rdb.JSONGet(ctx, \"bikes:inventory\", \"$..[*].colors\").Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res21)\n\t// >>> [[\"black\",\"silver\",\"pink\"],[\"black\",\"silver\",\"pink\"],[\"black\",\"white\"]]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex27",
      "language": "java",
      "code": "CompletableFuture<Void> updateFilters2 = asyncCommands.jsonArrappend(\"bikes:inventory\",\n                    JsonPath.of(\"$.inventory.*[?(@.price<2000)].colors\"), parser.createJsonValue(\"\\\"pink\\\"\")).thenCompose(r -> {\n                        System.out.println(r); // >>> [3, 3]\n\n                        return asyncCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..[*].colors\"));\n                    })\n                    .thenAccept(System.out::println)\n                    // >>> [[[\"black\",\"silver\",\"pink\"],[\"black\",\"white\"],[\"black\",\"silver\",\"pink\"]]]\n                    .toCompletableFuture();",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex28",
      "language": "java",
      "code": "Mono<Void> updateFilters2 = reactiveCommands.jsonArrappend(\"bikes:inventory\",\n                    JsonPath.of(\"$.inventory.*[?(@.price<2000)].colors\"), parser.createJsonValue(\"\\\"pink\\\"\")).collectList()\n                    .doOnNext(r -> {\n                        System.out.println(r); // >>> [3, 3]\n                    }).flatMap(r -> reactiveCommands.jsonGet(\"bikes:inventory\", JsonPath.of(\"$..[*].colors\")).collectList())\n                    .doOnNext(System.out::println) // >>>\n                                                   // [[[\"black\",\"silver\",\"pink\"],[\"black\",\"white\"],[\"black\",\"silver\",\"pink\"]]]\n                    .then();",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex29",
      "language": "java",
      "code": "List<Long> res43 = jedis.jsonArrAppendWithEscape(\n            \"bikes:inventory\", new Path2(\"$.inventory.*[?(@.price<2000)].colors\"),\n            \"\\\"pink\\\"\"\n        );\n        System.out.println(res43);  // >>> [3, 3]\n\n        Object res44 = jedis.jsonGet(\"bikes:inventory\", new Path2(\"$..[*].colors\"));\n        System.out.println(res44);\n        // >>> [[\"black\",\"silver\",\"\\\"pink\\\"\"],[\"black\",\"white\"],[\"black\",\"silver\",\"\\\"pink\\\"\"]]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex30",
      "language": "javascript",
      "code": "const res41 = await client.json.arrAppend(\n    \"bikes:inventory\", \"$.inventory.*[?(@.price<2000)].colors\", \"pink\"\n);\nconsole.log(res41);  //  [3, 3]\n\nconst res42 = await client.json.get(\"bikes:inventory\", {\n  path: \"$..[*].colors\"\n});\nconsole.log(res42);  //  [['black', 'silver', 'pink'], ['black', 'white'], ['black', 'silver', 'pink']]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex31",
      "language": "php",
      "code": "$res20b = $r->jsonarrappend('bikes:inventory', '$.inventory.*[?(@.price<2000)].colors', '\"pink\"');\n        echo json_encode($res20b) . PHP_EOL;\n        // >>> [3,3]\n\n        $res21b = $r->jsonget('bikes:inventory', '', '', '', '$..[*].colors');\n        echo $res21b . PHP_EOL;\n        // >>> [[\"black\",\"silver\",\"pink\"],[\"black\",\"white\"],[\"black\",\"silver\",\"pink\"]]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex32",
      "language": "python",
      "code": "res20 = r.json().arrappend(\n    \"bikes:inventory\", \"$.inventory.*[?(@.price<2000)].colors\", \"pink\"\n)\nprint(res20)  # >>> [3, 3]\n\nres21 = r.json().get(\"bikes:inventory\", \"$..[*].colors\")\nprint(\n    res21\n)  # >>> [['black', 'silver', 'pink'], ['black', 'white'], ['black', 'silver', 'pink']]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex33",
      "language": "ruby",
      "code": "res20 = r.json_arrappend(\n  'bikes:inventory', '$.inventory.*[?(@.price<2000)].colors', 'pink'\n)\np res20 # >>> [3, 3]\n\nres21 = r.json_get('bikes:inventory', '$..[*].colors')\np res21\n# >>> [[\"black\", \"silver\", \"pink\"], [\"black\", \"white\"], [\"black\", \"silver\", \"pink\"]]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex34",
      "language": "rust",
      "code": "let res44: Value = cmd(\"JSON.ARRAPPEND\")\n            .arg(\"bikes:inventory\")\n            .arg(\"$.inventory.*[?(@.price<2000)].colors\")\n            .arg(\"\\\"pink\\\"\")\n            .query_async(&mut r)\n            .await\n            .expect(\"Failed to run JSON.ARRAPPEND\");\n        print_redis_value(&res44); // >>> [3,3]\n\n        let res45: String = r\n            .json_get(\"bikes:inventory\", \"$..[*].colors\")\n            .await\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res45}\");\n        // >>> [[\"black\",\"silver\",\"pink\"],[\"black\",\"white\"],[\"black\",\"silver\",\"pink\"]]",
      "section_id": "update-examples"
    },
    {
      "id": "update-examples-ex35",
      "language": "rust",
      "code": "let res44: Value = cmd(\"JSON.ARRAPPEND\")\n            .arg(\"bikes:inventory\")\n            .arg(\"$.inventory.*[?(@.price<2000)].colors\")\n            .arg(\"\\\"pink\\\"\")\n            .query(&mut r)\n            .expect(\"Failed to run JSON.ARRAPPEND\");\n        print_redis_value(&res44); // >>> [3,3]\n\n        let res45: String = r\n            .json_get(\"bikes:inventory\", \"$..[*].colors\")\n            .expect(\"Failed to run JSON.GET\");\n        println!(\"{res45}\");\n        // >>> [[\"black\",\"silver\",\"pink\"],[\"black\",\"white\"],[\"black\",\"silver\",\"pink\"]]",
      "section_id": "update-examples"
    },
    {
      "id": "projection-expressions-ex0",
      "language": "plaintext",
      "code": "> JSON.SET doc $ '{\"a\":2,\"b\":4,\"arr\":[1,2,3]}'\nOK\n> JSON.GET doc '$.a + 1'\n\"[3]\"\n> JSON.GET doc '$.a * $.b'\n\"[8]\"\n> JSON.GET doc '($.a + $.b) / 2'\n\"[3.0]\"\n> JSON.GET doc '$.arr.length()'\n\"[3]\"\n> JSON.GET doc '$.a / 0'\n\"[]\"",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex1",
      "language": "csharp",
      "code": "bool res64 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":2,\\\"b\\\":4,\\\"arr\\\":[1,2,3]}\");\n        Console.WriteLine(res64);   // >>> True\n\n        RedisResult res65 = db.JSON().Get(\"doc\", path: \"$.a + 1\");\n        Console.WriteLine(res65);   // >>> [3]\n\n        RedisResult res66 = db.JSON().Get(\"doc\", path: \"$.a * $.b\");\n        Console.WriteLine(res66);   // >>> [8]\n\n        RedisResult res67 = db.JSON().Get(\"doc\", path: \"($.a + $.b) / 2\");\n        Console.WriteLine(res67);   // >>> [3.0]\n\n        RedisResult res68 = db.JSON().Get(\"doc\", path: \"$.arr.length()\");\n        Console.WriteLine(res68);   // >>> [3]\n\n        RedisResult res69 = db.JSON().Get(\"doc\", path: \"$.a / 0\");\n        Console.WriteLine(res69);   // >>> []",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex2",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":2,\"b\":4,\"arr\":[1,2,3]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\tres2, err := rdb.JSONGet(ctx, \"doc\", `$.a + 1`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> [3]\n\n\tres3, err := rdb.JSONGet(ctx, \"doc\", `$.a * $.b`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res3) // >>> [8]\n\n\tres4, err := rdb.JSONGet(ctx, \"doc\", `($.a + $.b) / 2`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res4) // >>> [3.0]\n\n\tres5, err := rdb.JSONGet(ctx, \"doc\", `$.arr.length()`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res5) // >>> [3]\n\n\tres6, err := rdb.JSONGet(ctx, \"doc\", `$.a / 0`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res6) // >>> []",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex3",
      "language": "java",
      "code": "CompletableFuture<Void> projBasicExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":2,\\\"b\\\":4,\\\"arr\\\":[1,2,3]}\"))\n                    .thenCompose(res1 -> {\n                        System.out.println(res1); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a + 1\"));\n                    }).thenCompose(res2 -> {\n                        System.out.println(res2); // >>> [[3]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a * $.b\"));\n                    }).thenCompose(res3 -> {\n                        System.out.println(res3); // >>> [[8]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"($.a + $.b) / 2\"));\n                    }).thenCompose(res4 -> {\n                        System.out.println(res4); // >>> [[3.0]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.arr.length()\"));\n                    }).thenCompose(res5 -> {\n                        System.out.println(res5); // >>> [[3]]\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a / 0\"));\n                    }).thenAccept(res6 -> {\n                        System.out.println(res6); // >>> [[]]\n                    }).toCompletableFuture();",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex4",
      "language": "java",
      "code": "Mono<Void> projBasicExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":2,\\\"b\\\":4,\\\"arr\\\":[1,2,3]}\"))\n                    .doOnNext(res1 -> {\n                        System.out.println(res1); // >>> OK\n                    })\n                    .flatMap(res1 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a + 1\")).collectList())\n                    .doOnNext(res2 -> {\n                        System.out.println(res2); // >>> [[3]]\n                    })\n                    .flatMap(res2 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a * $.b\")).collectList())\n                    .doOnNext(res3 -> {\n                        System.out.println(res3); // >>> [[8]]\n                    })\n                    .flatMap(res3 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"($.a + $.b) / 2\")).collectList())\n                    .doOnNext(res4 -> {\n                        System.out.println(res4); // >>> [[3.0]]\n                    })\n                    .flatMap(res4 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.arr.length()\")).collectList())\n                    .doOnNext(res5 -> {\n                        System.out.println(res5); // >>> [[3]]\n                    })\n                    .flatMap(res5 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a / 0\")).collectList())\n                    .doOnNext(res6 -> {\n                        System.out.println(res6); // >>> [[]]\n                    })\n                    .then();",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex5",
      "language": "java",
      "code": "String res64 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":2,\\\"b\\\":4,\\\"arr\\\":[1,2,3]}\");\n        System.out.println(res64);    // >>> OK\n\n        Object res65 = jedis.jsonGet(\"doc\", new Path2(\"$.a + 1\"));\n        System.out.println(res65);    // >>> [3]\n\n        Object res66 = jedis.jsonGet(\"doc\", new Path2(\"$.a * $.b\"));\n        System.out.println(res66);    // >>> [8]\n\n        Object res67 = jedis.jsonGet(\"doc\", new Path(\"($.a + $.b) / 2\"));\n        System.out.println(res67);    // >>> [3.0]\n\n        Object res68 = jedis.jsonGet(\"doc\", new Path2(\"$.arr.length()\"));\n        System.out.println(res68);    // >>> [3]\n\n        Object res69 = jedis.jsonGet(\"doc\", new Path2(\"$.a / 0\"));\n        System.out.println(res69);    // >>> []",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex6",
      "language": "javascript",
      "code": "const res64 = await client.json.set('doc', '$', { a: 2, b: 4, arr: [1, 2, 3] });\nconsole.log(res64); // >>> OK\n\nconst res65 = await client.json.get('doc', { path: '$.a + 1' });\nconsole.log(res65); // >>> [ 3 ]\n\nconst res66 = await client.json.get('doc', { path: '$.a * $.b' });\nconsole.log(res66); // >>> [ 8 ]\n\nconst res67 = await client.json.get('doc', { path: '($.a + $.b) / 2' });\nconsole.log(res67); // >>> [ 3 ]\n\nconst res68 = await client.json.get('doc', { path: '$.arr.length()' });\nconsole.log(res68); // >>> [ 3 ]\n\nconst res69 = await client.json.get('doc', { path: '$.a / 0' });\nconsole.log(res69); // >>> []",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex7",
      "language": "php",
      "code": "$res64 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => 2, \"b\" => 4, \"arr\" => [1, 2, 3]]\n        ));\n        echo $res64 . PHP_EOL; // >>> OK\n\n        $res65 = $this->redis->jsonget('doc', '', '', '', '$.a + 1');\n        echo $res65 . PHP_EOL; // >>> [3]\n\n        $res66 = $this->redis->jsonget('doc', '', '', '', '$.a * $.b');\n        echo $res66 . PHP_EOL; // >>> [8]\n\n        $res67 = $this->redis->jsonget('doc', '', '', '', '($.a + $.b) / 2');\n        echo $res67 . PHP_EOL; // >>> [3.0]\n\n        $res68 = $this->redis->jsonget('doc', '', '', '', '$.arr.length()');\n        echo $res68 . PHP_EOL; // >>> [3]\n\n        $res69 = $this->redis->jsonget('doc', '', '', '', '$.a / 0');\n        echo $res69 . PHP_EOL; // >>> []",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex8",
      "language": "python",
      "code": "res1 = r.json().set(\"doc\", \"$\", {\"a\": 2, \"b\": 4, \"arr\": [1, 2, 3]})\nprint(res1)\n# >>> True\n\nres2 = r.json().get(\"doc\", \"$.a + 1\")\nprint(res2)\n# >>> [3]\n\nres3 = r.json().get(\"doc\", \"$.a * $.b\")\nprint(res3)\n# >>> [8]\n\nres4 = r.json().get(\"doc\", \"($.a + $.b) / 2\")\nprint(res4)\n# >>> [3.0]\n\nres5 = r.json().get(\"doc\", \"$.arr.length()\")\nprint(res5)\n# >>> [3]\n\nres6 = r.json().get(\"doc\", \"$.a / 0\")\nprint(res6)\n# >>> []",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex9",
      "language": "ruby",
      "code": "res1 = r.json_set('doc', '$', { 'a' => 2, 'b' => 4, 'arr' => [1, 2, 3] })\nputs res1 # >>> OK\n\nres2 = r.json_get('doc', '$.a + 1')\np res2 # >>> [3]\n\nres3 = r.json_get('doc', '$.a * $.b')\np res3 # >>> [8]\n\nres4 = r.json_get('doc', '($.a + $.b) / 2')\np res4 # >>> [3.0]\n\nres5 = r.json_get('doc', '$.arr.length()')\np res5 # >>> [3]\n\nres6 = r.json_get('doc', '$.a / 0')\np res6 # >>> []",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex10",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":2,\"b\":4,\"arr\":[1,2,3]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", \"$.a + 1\").await {\n            Ok(res1) => {\n                let res1: String = res1;\n                println!(\"{res1}\");    // >>> [3]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a * $.b\").await {\n            Ok(res2) => {\n                let res2: String = res2;\n                println!(\"{res2}\");    // >>> [8]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"($.a + $.b) / 2\").await {\n            Ok(res3) => {\n                let res3: String = res3;\n                println!(\"{res3}\");    // >>> [3.0]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.arr.length()\").await {\n            Ok(res4) => {\n                let res4: String = res4;\n                println!(\"{res4}\");    // >>> [3]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a / 0\").await {\n            Ok(res5) => {\n                let res5: String = res5;\n                println!(\"{res5}\");    // >>> []\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex11",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":2,\"b\":4,\"arr\":[1,2,3]})) {\n            Ok(res64) => {\n                let res64: bool = res64;\n                println!(\"{}\", if res64 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a + 1\") {\n            Ok(res65) => {\n                let res65: String = res65;\n                println!(\"{res65}\");    // >>> [3]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a * $.b\") {\n            Ok(res66) => {\n                let res66: String = res66;\n                println!(\"{res66}\");    // >>> [8]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"($.a + $.b) / 2\") {\n            Ok(res67) => {\n                let res67: String = res67;\n                println!(\"{res67}\");    // >>> [3.0]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.arr.length()\") {\n            Ok(res68) => {\n                let res68: String = res68;\n                println!(\"{res68}\");    // >>> [3]\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }\n\n        match r.json_get(\"doc\", \"$.a / 0\") {\n            Ok(res69) => {\n                let res69: String = res69;\n                println!(\"{res69}\");    // >>> []\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex12",
      "language": "plaintext",
      "code": "> JSON.GET doc '$.a + 1' '$.b'\n\"{\\\"$.a + 1\\\":[3],\\\"$.b\\\":[4]}\"",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex13",
      "language": "csharp",
      "code": "bool res70 = db.JSON().Set(\"doc\", \"$\", \"{\\\"a\\\":2,\\\"b\\\":4,\\\"arr\\\":[1,2,3]}\");\n        Console.WriteLine(res70);   // >>> True\n\n        RedisResult res71 = db.JSON().Get(\"doc\", paths: new[] { \"$.a + 1\", \"$.b\" });\n        Console.WriteLine(res71);   // >>> {\"$.a + 1\":[3],\"$.b\":[4]}",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex14",
      "language": "go",
      "code": "res1, err := rdb.JSONSet(ctx, \"doc\", \"$\",\n\t\t`{\"a\":2,\"b\":4,\"arr\":[1,2,3]}`,\n\t).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res1) // >>> OK\n\n\traw, err := rdb.JSONGet(ctx, \"doc\", `$.a + 1`, `$.b`).Result()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// A multi-path JSON.GET reply is a JSON object whose key order is not\n\t// guaranteed, so decode it into a map rather than printing the raw\n\t// string. Go's fmt package prints map keys in sorted order, which keeps\n\t// this example's output deterministic regardless of the order Redis\n\t// returns the paths in.\n\tres2 := map[string]interface{}{}\n\n\tif err := json.Unmarshal([]byte(raw), &res2); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(res2) // >>> map[$.a + 1:[3] $.b:[4]]",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex15",
      "language": "java",
      "code": "CompletableFuture<Void> projMultipathExample = asyncCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH,\n                            parser.createJsonValue(\"{\\\"a\\\":2,\\\"b\\\":4,\\\"arr\\\":[1,2,3]}\"))\n                    .thenCompose(res7 -> {\n                        System.out.println(res7); // >>> OK\n                        return asyncCommands.jsonGet(\"doc\", JsonPath.of(\"$.a + 1\"), JsonPath.of(\"$.b\"));\n                    }).thenAccept(res8 -> {\n                        // The multi-path JSON.GET reply is a single JSON object keyed by path,\n                        // and Redis does not guarantee key order, so look up each path rather\n                        // than comparing the object's rendered string.\n                        JsonObject paths = res8.get(0).asJsonObject();\n                        System.out.println(paths); // >>> {\"$.a + 1\":[3],\"$.b\":[4]}\n                    }).toCompletableFuture();",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex16",
      "language": "java",
      "code": "Mono<Void> projMultipathExample = reactiveCommands\n                    .jsonSet(\"doc\", JsonPath.ROOT_PATH, parser.createJsonValue(\"{\\\"a\\\":2,\\\"b\\\":4,\\\"arr\\\":[1,2,3]}\"))\n                    .doOnNext(res7 -> {\n                        System.out.println(res7); // >>> OK\n                    })\n                    .flatMap(res7 -> reactiveCommands.jsonGet(\"doc\", JsonPath.of(\"$.a + 1\"), JsonPath.of(\"$.b\"))\n                            .collectList())\n                    .doOnNext(res8 -> {\n                        System.out.println(res8); // >>> [{\"$.a + 1\":[3],\"$.b\":[4]}]\n                    })\n                    .then();",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex17",
      "language": "java",
      "code": "String res70 = jedis.jsonSet(\"doc\", new Path2(\"$\"), \"{\\\"a\\\":2,\\\"b\\\":4,\\\"arr\\\":[1,2,3]}\");\n        System.out.println(res70);    // >>> OK\n\n        Object res71 = jedis.jsonGet(\"doc\", new Path2(\"$.a + 1\"), new Path2(\"$.b\"));\n        System.out.println(res71);    // >>> {\"$.a + 1\":[3],\"$.b\":[4]} (a JSON object; key order is not guaranteed)",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex18",
      "language": "javascript",
      "code": "const res70 = await client.json.set('doc', '$', { a: 2, b: 4, arr: [1, 2, 3] });\nconsole.log(res70); // >>> OK\n\nconst res71 = await client.json.get('doc', { path: ['$.a + 1', '$.b'] });\nconsole.log(res71); // >>> { '$.a + 1': [ 3 ], '$.b': [ 4 ] }",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex19",
      "language": "php",
      "code": "$res70 = $this->redis->jsonset('doc', '$', json_encode(\n            [\"a\" => 2, \"b\" => 4, \"arr\" => [1, 2, 3]]\n        ));\n        echo $res70 . PHP_EOL; // >>> OK\n\n        $res71 = $this->redis->jsonget('doc', '', '', '', '$.a + 1', '$.b');\n        // The reply is a JSON object keyed by path; key order is not guaranteed.\n        echo $res71 . PHP_EOL; // >>> {\"$.a + 1\":[3],\"$.b\":[4]} (key order not guaranteed)",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex20",
      "language": "python",
      "code": "res7 = r.json().set(\"doc\", \"$\", {\"a\": 2, \"b\": 4, \"arr\": [1, 2, 3]})\nprint(res7)\n# >>> True\n\nres8 = r.json().get(\"doc\", \"$.a + 1\", \"$.b\")\nprint(res8)\n# >>> {'$.a + 1': [3], '$.b': [4]}",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex21",
      "language": "ruby",
      "code": "res7 = r.json_set('doc', '$', { 'a' => 2, 'b' => 4, 'arr' => [1, 2, 3] })\nputs res7 # >>> OK\n\n# The reply's key order is not guaranteed, so don't rely on it.\nres8 = r.json_get('doc', '$.a + 1', '$.b')\np res8",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex22",
      "language": "rust",
      "code": "let _: bool = match r.json_set(\"doc\", \"$\", &json!({\"a\":2,\"b\":4,\"arr\":[1,2,3]})).await {\n            Ok(v) => v,\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        };\n\n        match r.json_get(\"doc\", &[\"$.a + 1\", \"$.b\"]).await {\n            Ok(res6) => {\n                let res6: String = res6;\n                // The reply's key order is not guaranteed, so parse it into a\n                // Value and compare that structurally rather than relying on\n                // the raw string's key order.\n                println!(\"{res6}\");\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "projection-expressions"
    },
    {
      "id": "projection-expressions-ex23",
      "language": "rust",
      "code": "match r.json_set(\"doc\", \"$\", &json!({\"a\":2,\"b\":4,\"arr\":[1,2,3]})) {\n            Ok(res70) => {\n                let res70: bool = res70;\n                println!(\"{}\", if res70 { \"OK\" } else { \"(nil)\" });    // >>> OK\n            },\n            Err(e) => {\n                println!(\"Error setting doc: {e}\");\n                return;\n            }\n        }\n\n        // A multi-path JSON.GET replies with an object keyed by path, but Redis does not\n        // guarantee the key order in that reply, so this parses the JSON and compares it\n        // structurally (map equality, order-independent) instead of comparing raw strings.\n        match r.json_get::<_, _, String>(\"doc\", vec![\"$.a + 1\", \"$.b\"]) {\n            Ok(res71) => {\n                let parsed: serde_json::Value = serde_json::from_str(&res71).unwrap();\n                // Render with sorted keys purely for a deterministic, printable example —\n                // the actual reply's key order can differ from run to run.\n                let sorted: std::collections::BTreeMap<String, serde_json::Value> =\n                    serde_json::from_value(parsed.clone()).unwrap();\n                println!(\"{}\", serde_json::to_string(&sorted).unwrap());    // >>> {\"$.a + 1\":[3],\"$.b\":[4]}\n            },\n            Err(e) => {\n                println!(\"Error getting doc: {e}\");\n                return;\n            }\n        }",
      "section_id": "projection-expressions"
    }
  ]
}
