# How to create a AQL query corresponding to a Java Key object

**URL:** <https://discuss.aerospike.com/t/how-to-create-a-aql-query-corresponding-to-a-java-key-object/8571>\
**Category:** AQL\
**Tags:** key, java\
**Created:** [June 23, 2021, 9:58pm UTC](https://discuss.aerospike.com/t/how-to-create-a-aql-query-corresponding-to-a-java-key-object/8571 "2021-06-23T21:58:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shan.p](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/shan.p/32/1990_2.png) [@shan.p](https://discuss.aerospike.com/u/shan.p)\
**Post date:** [June 23, 2021, 9:58pm UTC](https://discuss.aerospike.com/t/how-to-create-a-aql-query-corresponding-to-a-java-key-object/8571/1 "2021-06-23T21:58:20Z")

</div>

I have a Java project where I can view (debug) the Key of every record saved in the namespace. This is my Key value when printed to String: `{Key@11379} "namespace:null:u17c3304e-9c9b-4905-9889-a9cf2b26dc9c:948b5799fd2f6d5e827e1eb3c5d1a14dfd31bccf"`

How can I write a AQL query to identify this record in AQL? I need this to debug the logic. This is similar to [AQL select with PK - #10 by kyle-banta-yoshida](https://discuss.aerospike.com/t/aql-select-with-pk/3314/10) , however that thread deals with inserting the record via AQL with send\_key option.

Can you please suggest how to construct the query to view the record, from the Key value?

---

<div class="post-metadata">

**Author:** ![neelp](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/neelp/32/1369_2.png) [@neelp](https://discuss.aerospike.com/u/neelp)\
**Post date:** [June 27, 2021, 5:58pm UTC](https://discuss.aerospike.com/t/how-to-create-a-aql-query-corresponding-to-a-java-key-object/8571/2 "2021-06-27T17:58:38Z")

</div>

The key when printed shows the following structure: \<namespace\>:\<set\>:\<user-key\>:\<digest\>.

You can retrieve the record in aql with: select \* from \<namespace\>.\<set\> where DIGEST=“\<digest\>”.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/system/32/2274_2.png) [@system](https://discuss.aerospike.com/u/system)\
**Post date:** [September 19, 2021, 5:58pm UTC](https://discuss.aerospike.com/t/how-to-create-a-aql-query-corresponding-to-a-java-key-object/8571/3 "2021-09-19T17:58:49Z")

</div>

This topic was automatically closed 84 days after the last reply. New replies are no longer allowed.
