code: def test_objkeys_dollar(client):
      client.json().set(
          "doc1",
          "$",
          {
              "nested1": {"a": {"foo": 10, "bar": 20}},
              "a": ["foo"],
              "nested2": {"a": {"baz": 50}},
          },
      )
  
      # Test single
      assert client.json().objkeys("doc1", "$.nested1.a") == [
          ["foo", "bar"]
      ]
  
      # Test legacy
      assert client.json().objkeys("doc1", ".*.a") == ["foo", "bar"]
      # Test single
      assert client.json().objkeys("doc1", ".nested2.a") == ["baz"]
  
      # Test missing key
      assert client.json().objkeys("non_existing_doc", "..a") is None
  
      # Test non existing doc
      with pytest.raises(exceptions.ResponseError):
          assert client.json().objkeys("non_existing_doc", "$..a") == []
  
      assert client.json().objkeys("doc1", "$..nowhere") == []
  
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 39 for calling a global function with example usage: test_objkeys_dollar(client) without return types