code: def test_arrinsert_dollar(client):
      client.json().set(
          "doc1",
          "$",
          {
              "a": ["foo"],
              "nested1": {"a": ["hello", None, "world"]},
              "nested2": {"a": 31},
          },
      )
      # Test multi
      assert client.json().arrinsert(
          "doc1", "$..a", "1", "bar", "racuda"
      ) == [3, 5, None]
  
      res = [
          {
              "a": ["foo", "bar", "racuda"],
              "nested1": {
                  "a": ["hello", "bar", "racuda", None, "world"]
              },
              "nested2": {"a": 31},
          }
      ]
      assert_resp_response(
          client, client.json().get("doc1", "$"), res, [res]
      )
  
      # Test single
      assert client.json().arrinsert(
          "doc1", "$.nested1.a", -2, "baz"
      ) == [6]
      res = [
          {
              "a": ["foo", "bar", "racuda"],
              "nested1": {
                  "a": ["hello", "bar", "racuda", "baz", None, "world"]
              },
              "nested2": {"a": 31},
          }
      ]
      assert_resp_response(
          client, client.json().get("doc1", "$"), res, [res]
      )
  
      # Test missing key
      with pytest.raises(exceptions.ResponseError):
          client.json().arrappend("non_existing_doc", "$..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 35 for calling a global function with example usage: test_arrinsert_dollar(client) without return types