code: def test_json_delete_with_dollar(client):
      doc1 = {"a": 1, "nested": {"a": 2, "b": 3}}
      assert client.json().set("doc1", "$", doc1)
      assert client.json().delete("doc1", "$..a") == 2
      res = [{"nested": {"b": 3}}]
      assert_resp_response(
          client, client.json().get("doc1", "$"), res, [res]
      )
  
      doc2 = {
          "a": {"a": 2, "b": 3},
          "b": ["a", "b"],
          "nested": {"b": [True, "a", "b"]},
      }
      assert client.json().set("doc2", "$", doc2)
      assert client.json().delete("doc2", "$..a") == 1
      res = [{"nested": {"b": [True, "a", "b"]}, "b": ["a", "b"]}]
      assert_resp_response(
          client, client.json().get("doc2", "$"), res, [res]
      )
  
      doc3 = [
          {
              "ciao": ["non ancora"],
              "nested": [
                  {"ciao": [1, "a"]},
                  {"ciao": [2, "a"]},
                  {"ciaoc": [3, "non", "ciao"]},
                  {"ciao": [4, "a"]},
                  {"e": [5, "non", "ciao"]},
              ],
          }
      ]
      assert client.json().set("doc3", "$", doc3)
      assert client.json().delete("doc3", '$.[0]["nested"]..ciao') == 3
  
      doc3val = [
          [
              {
                  "ciao": ["non ancora"],
                  "nested": [
                      {},
                      {},
                      {"ciaoc": [3, "non", "ciao"]},
                      {},
                      {"e": [5, "non", "ciao"]},
                  ],
              }
          ]
      ]
      assert_resp_response(
          client, client.json().get("doc3", "$"), doc3val, [doc3val]
      )
  
      # Test default path
      assert client.json().delete("doc3") == 1
      assert client.json().get("doc3", "$") is None
  
      client.json().delete("not_a_document", "..a")
  
imports: import pytest
  import redis
  from redis import Redis, exceptions
  from redis.commands.json.decoders import decode_list, unstring
  from redis.commands.json.path import Path
  from .conftest import _get_client, assert_resp_response, skip_ifmodversion_lt
label_desc: Use image node_id 28 for calling a global function with example usage: test_json_delete_with_dollar(client) without return types